此 setTimeout 在 Firefox 中完美运行,但在 Chrome 中,函数 timeoutTrigger 中的任何事情都不会发生,包括警报。有什么想法吗?
var $this = $('.active-more');
function timeoutTrigger() {
$this.closest(".container").nextAll(".container:first").find(".description:first").removeClass('hide');
$this.closest(".container").nextAll(".container:first").find(".back:first").find("img.portfolio").remove();
alert("is this thing on?");
}
setTimeout(function(){timeoutTrigger()},400)
最佳答案
将您的 setTimeout
语句切换为以下内容:setTimeout(timeoutTrigger,400);
你写的是当你调用的函数有一个参数时。此外,您还缺少一个分号。
关于javascript - setTimeout 在 Chrome 中似乎不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14150802/