Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 1.24 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. });