鼠标进入jquery时如何停止淡入淡出动画?我有这样的代码
function fadeItIn() {
$('.banner_outer1').fadeIn(time, function () {
$('.banner_outer1').mouseenter(function(){
//stop animation
});
$('.banner_outer1').mouseout(function(){
//start animation
});
setTimeout(fadeItOut, 1400);
//fadeItOut();
});
}
function fadeItOut() {
$('.banner_outer1').fadeOut(time, function () {
$('.banner_outer1').html(banner_outer2);
banner_outer3 = banner_outer2;
banner_outer2 = banner_outer1;
banner_outer1 = banner_outer3;
fadeItIn();
});
}
我想在鼠标进入 div 时停止动画,并在鼠标离开 div 时恢复动画。我怎么能在jquery中做?