<div class="codetitle"> <span><a style="CURSOR: pointer" data="86152" class="copybut" id="copybut86152" onclick="doCopy('code86152')"><u>复制代码</u></a></span>代码如下:</div> <div class="codebody" id="code86152"> <br><!DOCTYPE HTML> <br> <br> <br><meta http-equiv="content-type" charset="utf-8" /> <br><meta http-equiv="content-type" content="text/html" /> <br><title>デモ</title> <br></head> <br><style type="text/css"> <br>ul,li,img{margin:0;padding:0;border:0;} <br>#list{height:250px;list-style-type:none;overflow:hidden;} <br>< /スタイル> <BR><本体> <BR><div id="odiv" style="position:absolute;width:200px;height:100px;background:red;left:0;border:1px Solid #333;"></div> <br><script type="text/javascript"> <br>var odiv=document.getElementById('odiv'); <br>odiv.onmouseover=function(){ <br>move(this,'width',500,function(){ <br>move(odiv,'left',300,function(){ <br>move( odiv,'height',500,function(){ <br>move(odiv,'borderWidth',10) <br>}) <br>})});} <br>function move(obj,arr,target ,fn){ <br>var dt=null,speed=0,ol=0; <br>clearInterval(dt); <br>dt=setInterval(function(){ <br>ol=parseInt(obj.style[arr]); <br>if(ol==target){ <br>clearInterval(dt); <br>if( fn) fn(); <br>}else{ <br>speed=(target-ol)/8; <br>speed>0?speed=Math.ceil(speed):speed=Math.floor(speed); <br>obj.style[arr]=ol 速度 "px" <br>} <br>},30); <br>} <br></script> <br></body> <br></html> <br> </div>