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

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

這段代碼move.js 為什么沒辦法使用。哪里出錯(cuò)了?

function getStyle(obj,attr){

if(obj.currentStyle){

return obj.currentStyle[attr];

}

else{

return obj.getComputed(obj,false)[attr];

}

}


function startMove(obj,json,fn){

clearInterval(obj.timer);


//設(shè)置標(biāo)桿

var flag=true;

//開啟定時(shí)器

obj.timer=setInterval(function(){

var icur=0;

//獲取當(dāng)前值

//遍歷json

for(var attr in json){}

if(attr=='opcity'){

icur=Math.round(parseFloat(getStyle(obj,attr))*100);

}

else{

icur=parseInt(getStyle(obj,attr));

}

//計(jì)算速度。

var speed=(json[attr]-icur)/8;

speed=speed>0?Math.ceil(speed):Math.floor(speed);


//檢測(cè)停止。

if(icur!=json[attr]){

return flag=false;

if(attr=='opcity'){

//針對(duì)IE瀏覽器

obj.style.filter='alpha(opcity+'+(icur+speed)+')';

//針對(duì)firefox/chrom瀏覽器

obj.style.opacity=(icur+speed)/100;

}else{

obj.style[attr]=icur+speed+'px';

}

}else{

return flag=ture;

}

if(flag){

clearInterval(obj.timer);

if(fn){

fn();

}

}

},30);

}

//html部分

<!DOCTYPE html>


<html>


<head>


<meta charset="UTF-8">


<title>淘寶網(wǎng)便民服務(wù)JS動(dòng)畫效果</title>

<style type="text/css">

*{

margin: 0;

padding: 0;

}

#move{

overflow:hidden;

border:3px solid #A19494;

margin:100px auto;

width:400px;

height:300px;

background-color: hotpink

}

a{

color:green;

font-weight: bold;

font-family: "微軟雅黑";

margin: 20px;

display: inline-block;

padding-top:70px;

height:40px;

width:80px;

text-align: center;

position: relative;

text-decoration: none;

border:2px solid blue;

background-color: white;

}

a:hover{

color: #97F405;

text-decoration:underline;

}

i{

position: absolute;

top:30px;

left:25px;

margin: auto 0px;

filter:alpha(opacity:100);

opacity: 1;

}

#move img{

border:none;

}

</style>

<script src="move.js"></script>


<script >

window.onload=function(){

var oMove=document.getElementById('move');

var List=oMove.getElementsByTagName('a');

for(var i=0;i<List.length;i++){

List[i].onmouseover=function()

var _this=this.getElementsByTagName('i')[0];

startMove(_this,{top:-35,opacity:0},function(){

_this.style.top=35px;

startMove(_this,{top:30px,opacity:1});

});

}

}

}

</script>

</head>


<body>


<div id="move">


<a href="#"><i>

<img src="http://img1.sycdn.imooc.com//58ef31870001b76100240024.jpg">

</i><p>華為手機(jī)</p></a>


<a href="#"><i>

<img src="http://img1.sycdn.imooc.com//58ef318700019e0900240018.jpg">

</i><p>蘋果手機(jī)</p></a>


<a href="#"><i><img src="http://img1.sycdn.imooc.com//58ef318700016c4500240022.jpg"></i><p>小米手機(jī)</p></a>


<a href="#"><i>

<img src="http://img1.sycdn.imooc.com//58ef3188000159a200240021.jpg">

</i><p>魅族手機(jī)</p></a>


<a href="#"><i>

<img src="http://img1.sycdn.imooc.com//58ef31880001f25500240022.jpg">

</i><p>金立手機(jī)</p></a>


<a href="#"><i>

<img src="http://img1.sycdn.imooc.com//58ef31a20001e01800240020.jpg">

</i><p>三星手機(jī)</p></a>


</div>


</body>


</html>


正在回答

1 回答

注釋為“檢測(cè)停止”那段代碼,把if里的return去掉

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

舉報(bào)

0/150
提交
取消

這段代碼move.js 為什么沒辦法使用。哪里出錯(cuò)了?

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

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

幫助反饋 APP下載

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

公眾號(hào)

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