Guest User

Untitled

a guest
Jan 16th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. $('#topnav').bind({
  2.  
  3. mouseenter: function() {
  4. $("#topnav").animate({opacity: 1.0, width: '98%', height: '38px'});
  5. },
  6. mouseleave: function() {
  7. $("#topnav").delay(2000).animate({opacity: 0.9, width: '310px', height: '33px'});
  8. }
  9.  
  10. });
  11.  
  12. var tout;
  13. $('#topnav').bind({
  14. mouseenter: function() {
  15. clearTimeout(tout);
  16. $("#topnav").animate({opacity: 1.0, width: '98%', height: '38px'});
  17. },
  18. mouseleave: function() {
  19. tout = setTimeout(function() {
  20. $("#topnav").animate({opacity: 0.9, width: '310px', height: '33px'});
  21. }, 2000);
  22. }
  23. });
  24.  
  25. var timeout = null
  26. var onMouseEnter = function(){
  27. clearTimeout(timeout)
  28. $("#topnav").animate({opacity: 1.0, width: '98%', height: '38px'})
  29. }
  30.  
  31. var onMouseLeave = function(){
  32. timeout = setTimeout(function(){
  33. $("#topnav").animate({opacity: 0.9, width: '310px', height: '33px'});
  34. },1000)
  35. }
  36.  
  37. $('#topnav').bind({ mouseenter: onMouseEnter, mouseleave: onMouseLeave })​
Add Comment
Please, Sign In to add comment