<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<div  style="position:absolute; border:1px; border-color:#0000FF; overflow:hidden; width:400px; height:100px ; top:2px; left:2px" onmousemove="stop()" onmouseout="move()">
<div id="div1"  style="width:400px; height:100px;  position:absolute; left:0px; top:0px; margin:0px"><img src="1.gif" width="100px" height="100px" /><img src="2.gif" width="100px" height="100px" /><img src="3.gif" width="100px" height="100px" /><img src="5.gif" width="100px" height="100px" /></div>
<div id="div2"  style="width:400px; height:100px;  position:absolute; left:400px; top:0px;"><img src="1.gif" width="100px" height="100px" /><img src="2.gif" width="100px" height="100px" /><img src="3.gif" width="100px" height="100px" /><img src="4.gif" width="100px" height="100px" /></div>
</div>
</body>
</html>
<SCRIPT language=javascript>
function move()
{
var v1=parseInt(document.all.div1.style.left); 
var v2=parseInt(document.all.div2.style.left); 
if(v1<=-400&&v2<=0) 
{
v1=0;
v2=400;
}
document.all.div1.style.left=v1-1 ;
document.all.div2.style.left=v2-1 ;
mo=setTimeout("move()",1); 
}
function stop()
{
clearTimeout(mo);
}
move()  </SCRIPT>知识点就这些,主要是算好距离