Posted By

createinside on 03/24/10


Tagged

menu jquery


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

tcelestino
x0nine


jQuery slide/fade menu


 / Published in: jQuery
 

  1. jQuery(function() {
  2.  
  3. var menu_speed = 175;
  4. var submenu_top = "17px";
  5. var submenu_top_from = "22px";
  6.  
  7. jQuery('#mainMenu LI').hover(function() {
  8.  
  9. var elem = jQuery(this).find('.sub_menu_wrapper');
  10.  
  11. elem.show();
  12. elem.css('top', submenu_top_from);
  13. elem.stop(true, false).animate({
  14. top: submenu_top,
  15. opacity : 1
  16. }, { queue:false, duration: menu_speed });
  17. //elem.fadeTo(menu_speed, 1);
  18.  
  19. }, function() {
  20.  
  21. var elem = jQuery(this).find('.sub_menu_wrapper');
  22.  
  23. //elem.show();
  24. elem.css('top', submenu_top);
  25. elem.animate({
  26. top: submenu_top_from,
  27. opacity : 0
  28. }, { queue:false, duration: menu_speed });
  29. elem.stop(true, false).fadeTo(menu_speed, 0, function() {
  30. elem.hide();
  31. });
  32. });
  33.  
  34. });

Report this snippet  

You need to login to post a comment.