Guest User

Untitled

a guest
May 5th, 2012
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. How can I prevent jquery.hover() from flickering other elements when moving the mouse between elements?
  2. function wkHover(){
  3. $('.worksItem').hover(function() {
  4. $(this).animate({ top: '-10px' }, 300, 'swing', {queue: false});
  5. $('.worksItem').not(this).animate({ opacity: '0.5' }, 300, 'swing', {queue: false});
  6. }, function(){
  7. $(this).animate({ top: '0' }, 200, 'swing', {queue: false});
  8. $('.worksItem').animate({ opacity: '1' }, 200, 'swing', {queue: false});
  9. });
  10. }
  11.  
  12. $(this).stop(true, true).animate(/***/);
  13.  
  14. $(this).stop('jump', true, true).animate({/***/}, {
  15. queue: 'jump'
  16. });
  17.  
  18. $(this).stop('jump', true, true).animate({/***/}, {
  19. queue: 'jump'
  20. })
  21. .dequeue('jump');
  22.  
  23. $(this).stop('fade', true).delay(300, 'fade').animate({ //***
  24.  
  25. $('.worksItem').hover(function() {
  26. $(this).stop(false, true)
  27. .animate({ top: '-10px' }, 300, 'swing', {queue: false});
  28. $('.worksItem').not(this).stop(false, true)
  29. .animate({ opacity: '0.5' }, 300, 'swing', {queue: false});
  30. }, function(){
  31. $(this).stop(false, true)
  32. .animate({ top: '0' }, 200, 'swing', {queue: false});
  33. $('.worksItem').not(this).stop(false, true)
  34. .animate({ opacity: '1' }, 200, 'swing', {queue: false});
  35. });
Advertisement
Add Comment
Please, Sign In to add comment