home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
mcgregor.k12.mn.us
/
www.mcgregor.k12.mn.us.tar
/
www.mcgregor.k12.mn.us
/
content
/
menu-collapsed.js
< prev
next >
Wrap
Text File
|
2010-09-08
|
1KB
|
70 lines
/*
Simple JQuery Collapsing menu.
HTML structure to use:
<ul id="menu">
<li><a href="#">Sub menu heading</a>
<ul>
<li><a href="http://site.com/">Link</a></li>
<li><a href="http://site.com/">Link</a></li>
<li><a href="http://site.com/">Link</a></li>
...
...
</ul>
<li><a href="#">Sub menu heading</a>
<ul>
<li><a href="http://site.com/">Link</a></li>
<li><a href="http://site.com/">Link</a></li>
<li><a href="http://site.com/">Link</a></li>
...
...
</ul>
...
...
</ul>
Copyright 2007 by Marco van Hylckama Vlieg
web: http://www.i-marco.nl/weblog/
email: marco@i-marco.nl
Free for non-commercial use
*/
function initMenu() {
$('#menu ul').slideToggle();
$('#menu li a').hover(
function() {
$(this).next().slideToggle('slow');
return false;
}
);
}
$(document).ready(function() {initMenu();});
if (location.pathname == 'aboutSchool.php')
{
//place jQuery code to be run here
$("#m1").slideToggle("slow");
}
else if (location.pathname == 'examplepage.php')
{
$("#m2").slideToggle("slow");
}
//...add more "else if" statements here, BEFORE "else" statement
else
{
//if all other conditions are not met, then run the code that is placed here.
//leave blank if you don't want anything else to happen.
}