<!DOCTYPE html><html><head>? ? <meta http-equiv="Content-type" content="text/html; charset=utf-8" />? ? <title>動畫</title><style type="text/css">?body,div,span{? ? ? ? ? ? margin:0;? ? ? ? ? ? padding:0;? ? ? ? }? ? #div1{? ? ? ? width:200px;? ? ? ? height:200px;? ? ? ? background:red;? ? ? ? position:relative;? ? ? ? left:-200px;? ? ? ? top:0;? ? }? ? #div1 span{? ? ? ? width:20px;? ? ? ? height:50px;? ? ? ? background:blue;? ? ? ? position:absolute;? ? ? ? left:200px;? ? ? ? top:75px;? ? }? ? </style></head><script>? ?window.onload=function(){? ? ? ?var Odiv=document.getElementById('div1');? ? ? ?Odiv.onmouseover=function(){? ? ? ? ? ?startmove();? ? ? ?}? ?}? ?var timer=null;? ? function startmove(){? ? ? ? var Odiv=document.getElementById('div1');timer=setInterval(function(){? ? ? ? ? ? if(Odiv.offsetLeft==0){? ? ? ? ? ? ? ? clearInterval(timer);? ? ? ? ? ? }? ? else{? ? ? ? Odiv.style.left=Odiv.offsetLeft+10+'px';}? ? ? ? },30)? ? }? ? </script><body><div id="div1"><span id="share">分享</span></div></body></html>
- 3 回答
- 0 關注
- 1347 瀏覽
相關問題推薦
添加回答
舉報
0/150
提交
取消