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

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

沒(méi)有源碼哦

沒(méi)有源碼參考哦,老師,麻煩提供一下源碼把。謝謝

正在回答

1 回答

startMove,去聽下DOM基本事件那屆!
function?startMove(obj,json,?fun)
	{
		clearInterval(obj.timer);
		obj.timer=setInterval
		(
			function()
			{
				for(var?attr?in?json)		//得到屬性
				{
					//取當(dāng)前的值
					var?cur=0;
					if(attr?==?'opacity')		//如果屬性為透明度
					{
						cur?=?Math.round(parseFloat(getStyle(obj,?attr))*100);
					}
					else
					{
						var?cur=parseInt(getStyle(obj,?attr));
					}
					//算速度
					//var?speed=(target-obj.offsetWidth)/8;
					var?speed=(json[attr]-cur)/8;
					speed=?(speed>0)???Math.ceil(speed)?:?Math.floor(speed);
					//檢測(cè)停止
					//if(obj.offsetWidth?==?target)
					if(cur?==?json[attr])
					{
						clearInterval(obj.timer);
						if(fun)
						{
							fun();
						}
					}
					else
					{
						if(attr?==?'opacity')
						{
							obj.style.filter?=?'alpha(opacity:'+(cur+speed)+')';
							obj.style.opacity=(cur+speed)/100;
						}
						else
						{
							//divs.style.width=divs.offsetWidth-1+'px';	//offsetWidth=208px(整個(gè)div的寬度margin?padding?border)	width=208-1px	207+8-1......
							//divs.style.width=parseInt(divs.style.width)-1+'px';		//width寫在行
							obj.style[attr]=cur+speed+'px';
						}
					}
				}
			},30
		);
	}
function?getStyle(obj,?attr)		//獲取CSS樣式
{
	if(obj.currentStyle)		//IE
	{
		return?obj.currentStyle[attr];
	}
	else
	{
		return?getComputedStyle(obj,?false)[attr];
	}
}//?JavaScript?Document	


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

舉報(bào)

0/150
提交
取消
網(wǎng)頁(yè)廣告特效
  • 參與學(xué)習(xí)       40170    人
  • 解答問(wèn)題       132    個(gè)

原來(lái)這么EASY,從淺到深,逐步優(yōu)化代碼,讓你深入理解

進(jìn)入課程

沒(méi)有源碼哦

我要回答 關(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)