wyclef
10-25-2010, 10:00 PM
using this...
/*
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').hide();
$('#rsch #menu #rsch-nav ul').show();
$('#stat #menu #stat-nav ul').show();
$('#menu li a.drop').click(
function() {
$(this).next().slideToggle('normal');
$(this).toggleClass('drop-down');
return false;
}
);
}
$(document).ready(function() {initMenu();});
i added these two lines
$('#rsch #menu #rsch-nav ul').show();
$('#stat #menu #stat-nav ul').show();
to keep the menus on specific pages dropped down...
it works, but the class doesn't stay toggled if i'm going to a sub page on those specific pages... any idea how i can keep the class toggled if those specific nav items are left dropped down?
/*
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').hide();
$('#rsch #menu #rsch-nav ul').show();
$('#stat #menu #stat-nav ul').show();
$('#menu li a.drop').click(
function() {
$(this).next().slideToggle('normal');
$(this).toggleClass('drop-down');
return false;
}
);
}
$(document).ready(function() {initMenu();});
i added these two lines
$('#rsch #menu #rsch-nav ul').show();
$('#stat #menu #stat-nav ul').show();
to keep the menus on specific pages dropped down...
it works, but the class doesn't stay toggled if i'm going to a sub page on those specific pages... any idea how i can keep the class toggled if those specific nav items are left dropped down?