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

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

為什么這個不能運(yùn)行?瀏覽器也沒有報錯錯在哪里了?

為什么這個不能運(yùn)行?瀏覽器也沒有報錯錯在哪里了?

前端大萌新 2016-10-04 20:43:12
<!DOCTYPE?html> <html> <head> <meta?charset="UTF-8"> <title>at?the?same?time?to?move</title> <style> #li1{ width:?200px; height:?100px; border:??3px?solid?black; opacity:?0.3; background-color:?yellow; list-style:?none; } </style> <script> function?startMove(obj,json,fn){ ??????clearInterval(obj.timer); ??????obj.timer=setInterval(function(){ ???????var?flag=true;//標(biāo)志所有運(yùn)動是否到達(dá)目標(biāo)值 ????????for(var?attr?in?json){ ????????var?curr=0; ?//判斷是否為透明度 ?if(attr=='opacity'){ curr=Math.round(parseFloat(getStyle(obj,attr))*100); ?}else{ curr=parseInt(getStyle(obj,attr)); ?} ?//移動速度處理 ?var?speed=0; ?speed=(json[attr]-curr)/10; ?speed=speed>0?Math.ceil(speed):Math.floor(speed); if(curr!=json[attr]){ flag=false; } if?(attr=='opacity')?{ obj.style.filter='alpha(opacity:'+(curr+speed)+")"; obj.style.opacity=(curr+speed)/100; }else{ obj.style[attr]=curr+speed+'px'; } } if(flag){ clearInterval(obj.timer); if(fn){ fn(); } ?} },30); } ?//取樣式 ??function?getStyle(obj,attr){ ?if(obj.currentStyle){???????//IE取樣式 return?obj.currentStyle[attr]; ?}else{ return?getComputedStyle(obj,null)[attr]; ?} ??} window.onload=function(){ var?Li=document.getElementById('li1'); Li.onmouseover=function(){ startMove(Li,{width:400,height:200,opacity:100}); } Li.onmouseover=function(){ ?startMove(Li,{width:200,height:100,opacity:30}); } }; </script> </head> <body> <ul> <li?id='li1'></li> </ul> </body> </html>
查看完整描述

1 回答

已采納
?
業(yè)余奶茶品鑒師

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

window.onload=function(){
????var?Li=document.getElementById('li1');
????Li.onmouseover=function(){
????????startMove(Li,{width:400,height:200,opacity:100});
????}
????Li.onmouseout=function(){
?????????startMove(Li,{width:200,height:100,opacity:30});
????}
};

你兩個都寫成Li.onmouseover 了。改成上面那樣就行。望采納

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

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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