<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> <br> <br> <br><meta http-equiv="content-type" charset="utf-8"> <br><meta http-equiv="content-type" content="text/html"> <br><title>demo</title> <br> <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></style> <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+speed+"px"; <BR>} <BR>},30); <BR>} <BR></script> <br> <br> <br> </div>