Dropdown on click, not hover
-
Hi all
I just started working with WP, and i have a couple of challenges with the menu. I know html and css, and i can edit in codes, but would rather not do that too much, I would like to use the GUI.
The theme is Tabula Rosa, which i stripped down, to make it as minimalistic as possible. The two dropdown menus slides open on hover, but i want to do it on click, and if possible, not link to a page. Then when i click on a child, i want that specific menu to stay open on the childs page.
I found something in the themes /js folder called menuslide.js. I will post the code here, I have a sneaking suspicion thats where i need to do something, but dont know what =)
The site is: sofiethorhauge.dk
var $j = jQuery.noConflict(); function menuSlide() { // Handling Menu Children $j(document).ready(function(){ $j("ul.children, ul.sub-menu").parent().addClass("dropdown"); //Adds a class to the elements that have a sub-menu $j("#menu li.dropdown").hover(function() { //When the mouse hovers over a main menu $j(this).addClass("subhover"); //Indicate that this item will be hover overed }, function(){ //On Hover Out $j(this).removeClass("subhover"); //On hover out, remove class "subhover" }).hover(function() { //Following events are applied to the sub-menu, children items (moving children up and down) $j(this).parent().find(".subhover ul.children, .subhover ul.sub-menu").slideDown('fast').show(); //Drop down the subnav when the mouse is over a specific element $j(this).parent().hover(function() { }, function(){ $j(this).parent().find("ul.children, ul.sub-menu").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up }); }); }); } $j(document).ready(function() { menuSlide(); });
The topic ‘Dropdown on click, not hover’ is closed to new replies.