Click here to Skip to main content
15,892,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a javascript written for Expanding/Collapsing the quick launch.It work's fine.
But the problemn is that i have some quick launch menu's without Sub-Menus(EG:Root2),So those which does not have the sub-menu I want the root menu to be redirected.The sub-Menu redirection is working Fine.

For Example:
Root1
->Sub Menu 1
->Sub Menu 2
Root2
Root3
->Sub Menu 1


Javascript:
<script type="text/javascript">

$(document).ready(function () {

$("div.menu-vertical>ul.root>li.static>a").toggle(
function () {
$(">ul", $(this).parent()).show("fast");
},
function () {
$(">ul", $(this).parent()).hide("fast");
}
);

$("div.menu-vertical>ul.root>li.static>ul.static").css("display","none");

var s = $("div.menu-vertical>ul.root>li.static>ul.static>li.selected").parent();
var p=s.parent();

p.find('ul').css("display","");

p.find('li').css("color","red");


});


</script>


Thanks
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900