Guest User

Untitled

a guest
May 14th, 2012
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. jQuery Animation Delay Adding A Class
  2. $(document).ready(function() {
  3.  
  4. $('.listing div').addClass('hideText');
  5.  
  6. $('.listing div').hover(
  7.  
  8. function() {
  9. $(this)
  10. .stop(true)
  11. .removeClass('hideText')
  12. .animate(
  13. {top: '0'},
  14. {duration: 300, easing: 'linear', queue: false}
  15. )
  16. },
  17. function() {
  18. $(this)
  19. .stop(true)
  20. .animate(
  21. {top: '150px'},
  22. {duration: 300, easing: 'linear', queue: false}
  23. )
  24. .addClass('hideText')
  25. });
  26.  
  27. $(document).ready(function() {
  28.  
  29. $('.listing div').addClass('hideText');
  30.  
  31. $('.listing div').hover(
  32.  
  33. function() {
  34. $(this)
  35. .stop(true)
  36. .removeClass('hideText')
  37. .animate(
  38. {top: '0'},
  39. {duration: 300, easing: 'linear', queue: false}
  40. )
  41. },
  42. function() {
  43. $(this)
  44. .stop(true)
  45. .animate(
  46. {top: '150px'},
  47. {duration: 300, easing: 'linear', queue: false},
  48. function() {
  49. $(this).addClass('hideText');
  50. }
  51. );
  52. });
  53. });
Advertisement
Add Comment
Please, Sign In to add comment