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

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

為什么動(dòng)畫會(huì)一直轉(zhuǎn)動(dòng)

<html>


<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>淘寶</title>

<style>

body,

div {

margin: 0;

padding: 0;

}

#pic {

width: 300px;

margin: 10px auto;

border: 1px solid #ccc;

background-color: pink;

}

#pic a {

display: inline-block;

width: 58px;

height: 25px;

border: 1px solid #ddd;

border-radius: 3px;

background-color: #fff;

text-align: center;

margin: 10px 17px;

position: relative;

padding: 40px 0px 10px 0px;

color: #9c9c9c;

font-size: 12px;

text-decoration: none;

line-height: 30px;

overflow: hidden;

}

#pic a i {

position: absolute;

top: 0px;

left: 0px;

display: inline-block;

width: 100%;

text-align: center;

fliter: alpha(opacity: 100);

opacity: 1;

}

#pic a:hover {

color: #F00;

}

#pic img {

border: none;

}

</style>

<script type="text/javascript" src="js/moves.js"></script>

<script>

window.onload = function() {

var Pic = document.getElementById('pic');

var aList = Pic.getElementsByTagName('a');

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

aList[i].onmouseover = function() {

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

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

_this.style.top = 60 + 'px';

startMove(_this, {top: 0,opacity: 100});

});

}

}

}

</script>

</head>


<body>

<div id="pic">

<a href="#"><i><img src="img/kkx.jpg" style="width: 58px;height: 60px;"/></i>

<p>1</p>

</a>

<a href="#"><i><img src="img/sm.jpg" style="width: 58px;height: 60px;"/></i>

<p>2</p>

</a>

<a href="#"><i><img src="img/mr.jpg" style="width: 58px;height: 60px;"/></i>

<p>3</p>

</a>

<a href="#"><i><img src="img/zz.jpg" style="width: 58px;height: 60px;"/></i>

<p>4</p>

</a>

<a href="#"><i><img src="img/you.jpg" style="width: 58px;height: 60px;"/></i>

<p>5</p>

</a>

<a href="#"><i><img src="img/ban.jpg" style="width: 58px;height: 60px;"/></i>

<p>6</p>

</a>

</div>

</body>


</html>


正在回答

2 回答

兄弟你確定改對(duì)了嗎?我改了以后就正常了:


源代碼如下:

index.html:

<html>
<head>
<meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"?/>
<title>淘寶</title>
<style>
body,
div?{
margin:?0;
padding:?0;
}
#pic?{
width:?300px;
margin:?10px?auto;
border:?1px?solid?#ccc;
background-color:?pink;
}
#pic?a?{
display:?inline-block;
width:?58px;
height:?25px;
border:?1px?solid?#ddd;
border-radius:?3px;
background-color:?#fff;
text-align:?center;
margin:?10px?17px;
position:?relative;
padding:?40px?0px?10px?0px;
color:?#9c9c9c;
font-size:?12px;
text-decoration:?none;
line-height:?30px;
overflow:?hidden;
}
#pic?a?i?{
position:?absolute;
top:?0px;
left:?0px;
display:?inline-block;
width:?100%;
text-align:?center;
fliter:?alpha(opacity:?100);
opacity:?1;
}
#pic?a:hover?{
color:?#F00;
}
#pic?img?{
border:?none;
}
</style>
<script?type="text/javascript"?src="js/move.js"></script>
<script>
window.onload?=?function()?{
var?Pic?=?document.getElementById('pic');
var?aList?=?Pic.getElementsByTagName('a');
for(var?i?=?0;?i?<?aList.length;?i++)?{
aList[i].onmouseenter?=?function()?{
var?_this?=?this.getElementsByTagName('i')[0];
startMove(_this,?{top:?-60,opacity:?0},?function()?{
_this.style.top?=?60?+?'px';
startMove(_this,?{top:?0,opacity:?100});
});
}
}
}
</script>
</head>
<body>
<div?id="pic">
<a?href="#"><i><img?src="img/a.jpg"?style="width:?58px;height:?60px;"/></i>
<p>1</p>
</a>
<a?href="#"><i><img?src="img/a.jpg"?style="width:?58px;height:?60px;"/></i>
<p>2</p>
</a>
<a?href="#"><i><img?src="img/a.jpg"?style="width:?58px;height:?60px;"/></i>
<p>3</p>
</a>
<a?href="#"><i><img?src="img/a.jpg"?style="width:?58px;height:?60px;"/></i>
<p>4</p>
</a>
<a?href="#"><i><img?src="img/a.jpg"?style="width:?58px;height:?60px;"/></i>
<p>5</p>
</a>
<a?href="#"><i><img?src="img/a.jpg"?style="width:?58px;height:?60px;"/></i>
<p>6</p>
</a>
</div>
</body>
</html>

move.js:

function?startMove(obj,json,fn){
??clearInterval(obj.timer);
??obj.timer?=?setInterval(function(){
????var?flag?=?true;
????for(var?attr?in?json){
??????var?icur?=?0;
??????if(attr?==?'opacity'){
????????icur?=?Math.round(parseFloat(getStyle(obj,attr))*100);
??????}?else?{
????????icur?=?parseInt(getStyle(obj,attr));
??????}
??????var?speed?=0;
??????speed?=?(json[attr]-icur)/10;
??????speed?=?speed?>0?Math.ceil(speed):Math.floor(speed);
??????if(json[attr]?!=?icur??){
????????flag?=?false;
????????if(attr?==?'opacity'){
??????????obj.style.filter?=?'alpha(opacity:'+(icur+speed)+')';
??????????obj.style[attr]?=?(icur+speed)/100;
????????}?else?{
??????????obj.style[attr]?=?icur?+?speed?+'px';
????????}
??????}
????}
????if(flag)?{
??????clearInterval(obj.timer);
??????if(fn){
????????fn();
??????}
????}
??},10);
}
function?getStyle(obj,attr){
??if(obj.currentStyle){
????return?obj.currentStyle[attr];
??}?else?{
????return?getComputedStyle(obj,false)[attr];
??}
}

圖片:a.jpg(隨意)

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

慕粉3122678

我改成了onmouseenter也好了。 但是如果是over的話,我鼠標(biāo)不移動(dòng),動(dòng)畫也還是會(huì)動(dòng)啊,top和opacity一直變。
2018-06-10 回復(fù) 有任何疑惑可以回復(fù)我~

你把onmouseover改成onmouseenter

onmouseover:只要鼠標(biāo)移動(dòng)就會(huì)觸發(fā),因此會(huì)重復(fù)觸發(fā)


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

小菜鳥飛

為什么我改成onmouseenter還是那樣
2016-08-24 回復(fù) 有任何疑惑可以回復(fù)我~
#2

小菜鳥飛

改了之后沒(méi)反應(yīng)
2016-08-24 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

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

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

進(jìn)入課程

為什么動(dòng)畫會(huì)一直轉(zhuǎn)動(dòng)

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