我有两个相同的 jsfiddles ,后者被 fadeIn/fadeOut 而不是 fadeToggle 取代。
只要用鼠标快速进出,最后一刻停留在黄色框上等待,红色元素不会淡入。
奇怪。有人对此有解释吗?
http://jsfiddle.net/q6d57/5/ (工作)
$(document).ready(function(){
$(".box1").mouseenter(function(){
$('.box2').stop(true, false).fadeToggle(1500);
});
$(".box1").mouseleave(function(){
$('.box2').stop(true, false).fadeToggle(1500);
});
});
和
http://jsfiddle.net/q6d57/6/ (不工作)
$(document).ready(function(){
$(".box1").mouseenter(function(){
$('.box2').stop(true, false).fadeIn(3000);
});
$(".box1").mouseleave(function(){
$('.box2').stop(true, false).fadeOut(3000);
});
});
最佳答案
将 jquery 版本更改为 2.0.2
关于javascript - 如果我用 fadeToggle 替换 fadeIn/fadeOut 为什么它不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20254924/