Guest User

Untitled

a guest
Mar 17th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.93 KB | None | 0 0
  1. jQuery(function($) {
  2.  
  3. //$("ul.menu li ul").hide();
  4.  
  5.     $("ul.menu li ul").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)
  6.  
  7.     //$("ul.menu li span").hover(function() { //When trigger is clicked...
  8.     $("ul.menu li a").hover(function() {
  9.                                        
  10.  
  11.         //Following events are applied to the subnav itself (moving subnav up and down)
  12.         $(this).parent().find("ul").slideDown('fast').show(); //Drop down the subnav on click
  13.  
  14.         $(this).parent().hover(function() {
  15.         }, function(){
  16.             $(this).parent().find("ul").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
  17.         });
  18.  
  19.         //Following events are applied to the trigger (Hover events for the trigger)
  20.         }).hover(function() {
  21.             $(this).addClass("subhover"); //On hover over, add class "subhover"
  22.         }, function(){  //On Hover Out
  23.             $(this).removeClass("subhover"); //On hover out, remove class "subhover"
  24.     });
  25.    
  26.  
  27. });
Add Comment
Please, Sign In to add comment