我試圖讓我的腳本顯示,而我的腳本在後臺運行,但它似乎是警報停止網站上的所有內容。有什麼方法可以防止這種情況發生,並在警報顯示時使腳本運行?功能:我想,而警報顯示運行function jobbig() { alert("JOBBIGT"); }
代碼:`警報停止腳本
}
function changez() {
if(y == 1) {
colour = "red";
y = 2;
}
else if(y == 2)
{
colour = "green";
y = 3;
}
else if(y == 3)
{
colour = "black";
y = 4;
}
else if(y == 4)
{
colour = "yellow";
y = 5;
}
else if(y == 5)
{
colour = "cyan";
y = 6;
}
else if(y == 6)
{
colour = "white";
y = 1;
}
document.getElementById("head").style.color = colour;
}`
function change() {
if(x == 1) {
color = "black";
x = 2;
}
else if(x == 2)
{
color = "white";
x = 3;
}
else if(x == 3)
{
color = "yellow";
x = 4;
}
else if(x == 4)
{
color = "red";
x = 5;
}
else if(x == 5)
{
color = "green";
x = 6;
}
else if(x == 6)
{
color = "cyan";
x = 7;
}
else if(x == 7)
{
color = "purple";
x = 1;
}
else if(x == 1337)
{
color = "white";
}
document.body.style.background = color; }
代碼由function andrafarg30() { clearInterval(interval2); clearInterval(interval3); clearInterval(intervall2); clearInterval(intervall3); x = 1; y = 1; interval1 = setInterval(change, 30); intervall1 = setInterval(changez, 45); }
這是由一個按鈕叫跑。警報也被一個按鈕調用。
我不是很熟悉jQuery,所以我不知道如何用我自己的代碼進行編譯。 – Grymfogel1
請檢查我最新的答案。 –