为了账号安全,请及时绑定邮箱和手机立即绑定

我这是哪错了

我这是哪错了

慕函数8404189 2017-05-29 15:19:09
<!doctype html><html><head><meta charset="UTF-8" /><title>Document</title><style type="text/css">*{margin: 0;padding: 0;}div{width: 100px;height: 100px;background: red;float: left;margin-right: 20px;position: relative;left:500px;top: 100px;filter: alpha(opacity = 30);opacity: 0.3;}</style><script type="text/javascript">window.onload=function(){var aDiv = document.getElementsByTagName('div');for(var i = 0;i<aDiv.length;i++){aDiv[i].timer = null;aDiv[i].Valpha = 30;aDiv[i].onmouseover = function(){startMove(this,30);}aDiv[i].onmouseout = function(){startMove(this,100);}}function startMove(obj,target){clearInterval(obj.timer);obj.timer = setInterval(function(){var speed = (target - obj.Valpha)/6;speed = speed > 0?Math.ceil(speed) : Math.floor(speed);if(obj.Valpha == target){clearInterval(obj.timer);}else{obj.Valpha += speed;obj.style.filter = 'alpha(opacity:' + obj.Valpha +')';obj.style.opacity = obj.Valpha;}},30)}}</script></head><body>       <div></div>       <div></div>       <div></div></body></html>
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 1364 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信