11

この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)
4

2 に答える 2

8

setTimeoutステートメントを次のように切り替えます。作成したステートメントsetTimeout(timeoutTrigger,400); は、呼び出している関数にパラメーターがある場合のものです。また、セミコロンがありません。

于 2013-01-04T03:47:49.793 に答える
-1

Googleは、一部のブラウザでのsetTimeout()の使用に影響を与えるコンテンツセキュリティポリシーを変更しました。読んでください:https ://developer.chrome.com/extensions/contentSecurityPolicy

于 2019-01-14T17:24:32.413 に答える