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

為了賬號安全,請及時綁定郵箱和手機立即綁定

鼠標移入后圖標不停的循環(huán),怎么讓它只做一次運動

<!DOCTYPE?html>

<html>

<head>

<meta?charset="UTF-8">

<title>任意屬性值</title>

<style?type="text/css">

*{margin:0;padding: 0;}
#move{
?? ?? width: 300px;
????? height: 220px;
????? background: #ccc;
????? text-align: center;
????? margin:50px 400px;}
?a{position: relative;
?? text-decoration: none;
?? display: inline-block;
?? background: white;
?? width: 60px;
?? height: 80px;
?? margin-top:20px;
?? margin-right: 20px;
??? }
i{position: absolute;
? margin:20px -20px;
? color: red;
? }
p{position: absolute;
? margin-top: 60px;
? margin-left: 15px;
? font-size: 12px;
? color: black;
? }

</style>

<script?type="text/javascript">

window.onload=function(){
??????????? var oDiv=document.getElementById("move");
??????????? var ali=document.getElementsByTagName("a");
??????????? for (var i = ali.length - 1; i >= 0; i--) {
??????????????? ali[i].onmouseover=function(){
??????????????????? var _this=this.getElementsByTagName("i")[0];
??????????????????? startMove(_this,{'margin-top':-5},function(){
??????????????????????? _this.style['margin-top']=35+'px';
??????????????????????? startMove(_this,{'margin-top':20})
??????????????????? });
??????????????? }
??????????? };
??????? }
function startMove(obj,json,fn){
??? clearInterval(obj.timer);
??? obj.timer=setInterval(function(){
?? ??? ?var flag=true;//用來判斷json是否全部執(zhí)行完
?? ??? ?for(var arr in json){
?? ??? ?var cur=0;
?? ??? ?if(arr=='opacity'){
?? ??? ??? ?cur=Math.round(parseFloat(getStyle(obj,arr))*100);
?? ??? ?}else{
?? ??? ??? ?cur=parseInt(getStyle(obj,arr));
?? ??? ?}
?? ??? ?var speed=(json[arr]-cur)/8;
?? ??? ?speed=speed>0?Math.ceil(speed):Math.floor(speed);
?? ??? ?
?? ??? ?if(cur!==json[arr]){//加入json沒有全部到達目標值,那么繼續(xù)則行
?? ??? ??? ?flag=false;
?? ??? ??? ?if(arr=='opacity'){
?? ??? ??? ??? ?obj.style.filter='alpha(opacity:'+(cur+speed)+')';
?? ??? ??? ??? ?obj.style.opacity=(cur+speed)/100;
?? ??? ??? ?}else{
?? ??? ??? ?obj.style[arr]=parseInt(cur)+speed+'px';
?? ??? ???? }
?? ??? ?}
?? ??? ???? if(flag){
?? ??? ??? ?clearInterval(obj.timer);
?? ??? ??? ?if(fn){
?? ??? ??? ??? ?fn();
?? ??? ??? ?}
?? ??? ?}
?? ?
?? ??? ?}
??? },30)
}
function getStyle(obj,arr){
?? ?if(obj.currentStyle){
?? ??? ?return obj.currentStyle[arr];
?? ?}else{
?? ??? ?return getComputedStyle(obj,false)[arr];
?? ?}
}

</script>

</head>

<body>
??? ?<div id="move">
??? ?<a href="www.baidu.com"><i id="icon1">$$$</i><p>話費</p></a>
??? <a href="www.baidu.com"><i id="icon2">!!!</i><p>充值</p></a>
??? <a href="www.baidu.com"><i id="icon3">###</i><p>游戲</p></a>
??? <a href="www.baidu.com"><i id="icon4">@@</i><p>旅游</p></a>
??? ?</div>
?</body>

</html>



正在回答

1 回答

onmouseover改為onmouseenter即可

0 回復 有任何疑惑可以回復我~
#1

追覓夢初的國度

我的也是這樣,我想問一下是冒泡的原因的嗎?如果是,我取消冒泡了還是這樣。我想知道其中的原因
2016-02-05 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

鼠標移入后圖標不停的循環(huán),怎么讓它只做一次運動

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

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

幫助反饋 APP下載

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

公眾號

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