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

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

文本框閃爍

文本框閃爍

qq_小盛開_0 2016-10-27 20:30:10
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>無標(biāo)題文檔</title></head><body style="text-align:center" onload="init();">? ? ? <input type="text" ?/><br /><br />? ? ? <input type="text" ?/>? ? ? <script type="text/javascript">? ? ? ? ?function init(){? ? ? ? ? ? ? ? ?var d=document.getElementsByTagName("input");? ? ? ? ? ? ? ? ? ? ? ? ? ?for(var i=0;i<d.length;i++){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? d[i].onfocus=function(){ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? timer=setInterval(function(){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? var c=this.style.borderColor; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? if(c=="yellow") ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? this.style.borderColor=""; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? } ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? else ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? { ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? this.style.borderColor="yellow"; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? } ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? },1000)? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? }? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? d[i].onblur=function(){? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? clearInterval(timer);? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? this.style.borderColor="";? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?}? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?} ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??? ? ? ? ? ? ? ? ? ? ? ? ?}??</script></body></html>
查看完整描述

2 回答

已采納
?
stone310

TA貢獻(xiàn)361條經(jīng)驗 獲得超191個贊

中間focus事件函數(shù)修改如下注釋:

d[i].onfocus=function(){
????var?self=this;?????????????//保存this,這里this指的是d[i]
????timer=setInterval(function(){
????????var?c=self.style.borderColor;??//用剛才保存的this值,因為這里的this值就是window,而不是d[i]了
????????if(c=="yellow")
????????{
????????????self.style.borderColor="";
????????}
????????else
????????{
????????????self.style.borderColor="yellow";
????????}
????},1000)
}


查看完整回答
反對 回復(fù) 2016-10-28
  • qq_小盛開_0
    qq_小盛開_0
    在if中self.style.borderColor改成c為什么不可以
  • stone310
    stone310
    什么意思,這里不已經(jīng)是 if(c=="yellow")嗎,能運(yùn)行啊
  • qq_小盛開_0
    qq_小盛開_0
    d[i].onfocus=function(){ var self=this; //保存this,這里this指的是d[i] timer=setInterval(function(){ var c=self.style.borderColor; //用剛才保存的this值,因為這里的this值就是window,而不是d[i]了 if(c=="yellow") { c=""; } else { c="yellow"; } },1000) 我把它改成這樣不能運(yùn)行的原因是什么?
點(diǎn)擊展開后面2
?
皓韻兒

TA貢獻(xiàn)86條經(jīng)驗 獲得超114個贊

??你確定嗎?為什么我復(fù)制粘貼的沒有閃爍? 是不是你沒有保存呀?保存試試,實在不行就重新打開你的編譯器試試。

查看完整回答
1 反對 回復(fù) 2016-10-27
  • 2 回答
  • 0 關(guān)注
  • 1366 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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