jQuery在父项hover时停止子元素动画

我正试图在#jam列表中设置div的动画。

li具有背景图像,当hover时显示框类。

我遇到的问题是,当我hover盒子类div时,它们会触发hover。

如何才能使li背景图像hover而不是其中的元素?

/*Services Pyrimid*/ $('ul#jam li').hover(function() { $(this).find('div:first').animate({opacity: 1.0, left:190}, 500); },function(){ $(this).find('div:first').animate({opacity: 0, left:-400}, 500); }); 
  • text
  • text

尝试添加:

 $(".box").on('mouseenter mouseleave', function(e) { e.stopPropagation(); }); 

或做:

 $('ul#jam li').not('.box').hover(function() {...