淡入 jquery [不工作]
FadeIn jquery [not working]
我是 jquery 的新人,我的淡入效果不工作。我在这里做了一个JSFIDDLE。谢谢
$('#menu > li').on('mouseover', function(e){
$(this).find("ul:first").fadeIn(120).finish();
$(this).find('> a').addClass('active');
}).on('mouseout', function(e){
$(this).find("ul:first").stop().finish().delay(500).fadeOut(120);
$(this).find('> a').removeClass('active');
});
移除.finish()
:
$('#menu > li').on('mouseover', function(e){
$(this).find("ul:first").fadeIn(120);
$(this).find('> a').addClass('active');
}).on('mouseout', function(e){
$(this).find("ul:first").stop().finish().delay(500).fadeOut(120);
$(this).find('> a').removeClass('active');
});
FIDDLE: https://jsfiddle.net/YGB5G/47/
来自jQuery site:
When .finish() is called on an element, the currently-running animation and all queued animations (if any) immediately stop and their CSS properties set to their target values. All queued animations are removed.
我是 jquery 的新人,我的淡入效果不工作。我在这里做了一个JSFIDDLE。谢谢
$('#menu > li').on('mouseover', function(e){
$(this).find("ul:first").fadeIn(120).finish();
$(this).find('> a').addClass('active');
}).on('mouseout', function(e){
$(this).find("ul:first").stop().finish().delay(500).fadeOut(120);
$(this).find('> a').removeClass('active');
});
移除.finish()
:
$('#menu > li').on('mouseover', function(e){
$(this).find("ul:first").fadeIn(120);
$(this).find('> a').addClass('active');
}).on('mouseout', function(e){
$(this).find("ul:first").stop().finish().delay(500).fadeOut(120);
$(this).find('> a').removeClass('active');
});
FIDDLE: https://jsfiddle.net/YGB5G/47/
来自jQuery site:
When .finish() is called on an element, the currently-running animation and all queued animations (if any) immediately stop and their CSS properties set to their target values. All queued animations are removed.