第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

假如計時器改變樣式,但沒有延時效果

<script type="text/javascript">

? ?var str = document.getElementById("con");

? ? str.style.color="red";

? ? str.style.backgroundColor="#CCC";

? ? //str.style.display="none";

? ? setTimeout(str.style.color="green", 10000);

? </script>


正在回答

3 回答

1,為什么沒延時效果,因為setTimeout("計算表達式或函數(shù)",時間)

<script type="text/javascript">

//第一種方法

function oColor(){

str.style.color="green";

}

window.onload=function(){

str=document.getElementById("con")

str.style.color="red";

str.style.backgroundColor="#CCC";

setTimeout("oColor()",1000)

}

//第二種方法

// ?window.onload=function(){

// ?var str=document.getElementById("con");

// ?str.style.color="red";

// ?str.style.backgroundColor="#CCC";

// ?setTimeout("document.getElementById('con').style.color='green'", 1000);

// ?}

</script>

//可能是黏貼的問題,排版只能這樣了,希望你能看懂

0 回復 有任何疑惑可以回復我~

<script type="text/javascript">

window.onload=function() {

var str = document.getElementById("con");

? ? ? ? ? ? ? str.style.color="red";

? ? ? ? ? ? ? str.style.backgroundColor="#CCC";

? ? ? ? ? ? ? ? // str.style.display="none";

}

? ? function change(){

? ? var str = document.getElementById("con");

? ? ? ? ?str.style.color="blue";

? ? ? ?}

? ? setTimeout("change()", 1000)

? ? </script>可以改成這樣,str.style.color="green"放進一個函數(shù)里

0 回復 有任何疑惑可以回復我~

setTimeout("str.style.color='green'", 10000); ?這樣寫

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

假如計時器改變樣式,但沒有延時效果

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號