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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

請(qǐng)問(wèn)這BUG是什么情況?

<!DOCTYPE?html>
<html>

	<head>
		<meta?charset="UTF-8">
		<title></title>
		<style?type="text/css">
			*?{
				margin:?0;
				padding:?0;
			}
			
			.lis?{
				height:?60px;
				width:?260px;
				background-color:?antiquewhite;
				border-radius:?60px;
				margin-top:?10px;
				line-height:?60px;
				text-align:?center;
				border:?5px?solid?cadetblue;
				opacity:?0.5;
				box-shadow:?5px?2px?10px?darkred;
			}
		</style>
	
		<script?type="text/javascript">
			function?getclsname(clsname,?parent)?{
				var?oparent?=?parent???document.getElementById(parent)?:?document,
					eles?=?[],
					elements?=?oparent.getElementsByTagName("*");
				for?(var?i?=?0,?l?=?elements.length;?i?<?l;?i++)?{
					if?(elements[i].className?==?clsname)?{
						eles.push(elements[i]);
					}
				}
				return?eles;
			}
/*			function?getstyle(obj,sty){
				if(obj.currentStyle){
					return?obj.currentStyle[sty];
				}else{
					return?getComputedStyle(obj,null)[sty];
				}
			}*/
			
			window.onload?=?function()?{
				var?lis?=?getclsname("lis",?"oul"),
					btn=document.getElementById("bt"),
					txt=document.getElementById("text"),
					speed?=?10,
					sty?=?null;
				btn.onclick=function(){
					sty=txt.value;
					document.title=sty;
				}
				for?(var?i?=?0,?l?=?lis.length;?i?<?l;?i++)?{
					this.timer=null;
					lis[i].onmouseover?=?function()?{
						lis_over(this,?speed,?0,?500,1,sty);
					}
					lis[i].onmouseleave?=?function()?{
						lis_over(this,?speed,?1,?260,0.5,sty);
					}
				}
			}

			function?lis_over(obj,?speed,?lg,?itg,op,sty)?{
				clearInterval(obj.timer);
				obj.timer?=?setInterval(function()?{
					var?wd=window.getComputedStyle(obj,null)[sty];
					if(sty=='opacity'){
						wd=Math.round(parseFloat(wd)*100);
					}else{
						wd=parseInt(wd);
					}
					if?(wd?==?itg||wd/100==op)?{
						clearInterval(obj.timer);
					}?else?{
						if(lg!=0){
							speed=-10;
						}
						if(sty=='opacity'){
							var?a?=?wd?+?speed;
							if(a<0||a==0){
								obj.style[sty]?=?op;
								clearInterval(obj.timer);
							}else{
								obj.style[sty]?=?a/100;
							}
						}else{
							if(wd>itg&&lg!=0){
								obj.style[sty]=itg+"px";
								clearInterval(obj.timer);
							}else?if(wd<itg&&lg==0){
								obj.style[sty]=itg+"px";
								clearInterval(obj.timer);
							}
							if(wd>800/2){
								if(lg==0){speed=sp+10;}
								else{speed=-sp-10;}
							}
							obj.style[sty]?=?wd?+?speed?+?"px";
						}
					}

				},?100)
			}

		</script>
	</head>

	<body>
		<div>
			<input?type="text"?id="text"?style="color:grey"?value="opacity"?onfocus="this.value=''"/>
			<input?type="button"?id="bt"?value="確定"?/>
		</div>
		<ul?id=oul>
			<li?class="lis">imooc</li>
			<li?class="lis"></li>
			<li?class="lis"></li>
			<li?class="lis"></li>
			<li?class="lis"></li>
			<li?class="lis"></li>
		</ul>
	</body>

</html>

輸入“width",點(diǎn)擊確定,width值只會(huì)增長(zhǎng)一次,然后就被clearinterval了,明明是&&,怎么還是直接執(zhí)行了?非常感謝!

正在回答

4 回答

width的第一次 onmouseover觸發(fā)參數(shù)為 wd=260,itg=500,lg=0,滿足 else?if(wd<itg&&lg==0) 這個(gè)條件,自然就被你clear掉了

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

飛天意大利面神獸 提問(wèn)者

非常感謝!
2016-07-04 回復(fù) 有任何疑惑可以回復(fù)我~

致謝!

0 回復(fù) 有任何疑惑可以回復(fù)我~

else?if(wd<itg&&lg==0){

????????????????????????????????obj.style[sty]=itg+"px";

????????????????????????????????clearInterval(obj.timer);

????????????????????????????}

中的clearInterval(obj.timer);刪掉就行了

1 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
JS動(dòng)畫(huà)效果
  • 參與學(xué)習(xí)       113920    人
  • 解答問(wèn)題       1487    個(gè)

通過(guò)本課程JS動(dòng)畫(huà)的學(xué)習(xí),從簡(jiǎn)單動(dòng)畫(huà)開(kāi)始,逐步深入各種動(dòng)畫(huà)框架封裝

進(jìn)入課程

請(qǐng)問(wèn)這BUG是什么情況?

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

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

幫助反饋 APP下載

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

公眾號(hào)

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