我正在尝试创建幻灯片导航。
我的代码:
$('.feeds_text p:visible').hide("slide", { direction: "right" }, 300, function() {
$('#quote_' + currentKey).show("slide", { direction: "left" }, 300)
});
但是当两个 div 之间有旋转的白色区域时,这个函数会依次执行并创建时间。如何同时使用这两个功能?我只需要使用隐藏/显示功能。
最佳答案
干脆不要使用回调函数,
如果 '#quote_' + currentKey
也有类 .feeds_text
.stop()
$('.feeds_text p:visible').hide("slide", { direction: "right" }, 300);
$('#quote_' + currentKey).stop().show("slide", { direction: "left" }, 300);
关于javascript - jquery同时隐藏/显示效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23989164/