1 <!DOCTYPE HTML>2 <HTML>3 <Head>4 <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8">5 <title>Untitled Document</title>6 <style>7 #div1{width:100px;Height:200px;background:Red;position:Absolute; Left:-100px;Top:100px;}8 #div2{width:30px;Height:60px;background:Black;position:Absolute; Right:-30px;Top:70px;Color: White;text-align:Center;}9 </style>Ten <Script> One window.onload= function() { A - varODiv1=document.getElementById ('Div1'); - varODiv2=document.getElementById ('Div2'); the varITimer= NULL; - - Odiv1.onmouseover= function() { - Startmove (0, Ten); + } - + Odiv1.onmouseout= function() { A Startmove (- -, -Ten); at } - - functionStartmove (ITarget, ispeed) { - clearinterval (iTimer); - - ITimer=SetInterval (function() { in - if(Odiv1.offsetleft==itarget) { to clearinterval (iTimer); + } Else { - ODiv1.style.left=Odiv1.offsetleft+Ispeed+ 'px'; the } * $ }, -);Panax Notoginseng } - the } + </Script> A </Head> the + <Body> - <DivID= "Div1"> $ <DivID= "Div2">Share to</Div> $ </Div> - </Body> - </HTML>