Title: Dropdown on click, not hover
Last modified: August 20, 2016

---

# Dropdown on click, not hover

 *  [Prefoamed](https://wordpress.org/support/users/prefoamed/)
 * (@prefoamed)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/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](http://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.

## Tags

 * [dropdown](https://wordpress.org/support/topic-tag/dropdown/)
 * [hover](https://wordpress.org/support/topic-tag/hover/)
 * [java](https://wordpress.org/support/topic-tag/java/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [js](https://wordpress.org/support/topic-tag/js/)
 * [menu](https://wordpress.org/support/topic-tag/menu/)
 * [stay open](https://wordpress.org/support/topic-tag/stay-open/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Prefoamed](https://wordpress.org/support/users/prefoamed/)
 * Last activity: [14 years, 8 months ago](https://wordpress.org/support/topic/dropdown-on-click-not-hover/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
