亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

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

透明值不為整值1,而是0.83。我找不原因

透明值不為整值1,而是0.83。我找不原因

情積雪 2016-05-22 23:12:04
<script type="text/javascript">window.onload = function(){ var content = document.getElementsByClassName('content')[0]; var A = document.getElementsByTagName('a'); for(var i = 0; i<A.length; i++){ A[i].onmouseenter = function(){ var _this = this.getElementsByTagName('i')[0]; move(_this,{top:-25,opacity:0},function(){ _this.style.top=35 + 'px'; move(_this,{top:20,opacity:100}); }); } } } function move(obj,json,fu){ clearInterval(obj.time); obj.time = setInterval(function(){ for(var attr in json){ var flag = true; 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)/8; speed=speed>0?Math.ceil(speed):Math.floor(speed); if(icur != json[attr]){ flag = false; } if(attr == 'opacity'){ obj.style[attr] = (icur + speed)/100; obj.style.filter='alpha(opacity:'+(icur+speed)+')'; }else{ obj.style[attr] = icur + speed + 'px'; } if(flag){ clearInterval(obj.time); if(fu){ fu(); } } } },10); } function getStyle(obj,attr){? ?if(obj.currentStyle){? ? return obj.currentStyle[attr];? ?}else{? ? return getComputedStyle(obj,false)[attr];? ?}}</script>
查看完整描述

1 回答

?
一杯2塊的奶茶

TA貢獻226條經驗 獲得超75個贊


html代碼呢

查看完整回答
反對 回復 2016-05-24
  • 1 回答
  • 0 關注
  • 1251 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號