this sliding animation works just fine with setInterval but doesn't work with setTimeout though i used setTimeout inside the function "scroll" so that it loops the function every time its been encountered
HTML Code:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<style>
#container{
	width:620px;
	height:100px;
	border:1px solid red;
	overflow:hidden;
	position:relative;
}
#div1{
	position:absolute;
	left:0px;
	top:0px;
	width:620px;
	height:100px;
	padding:1px;
}
#div2{
	position:absolute;
	left:620px;
	width:620px;
	height:100px;
	padding:1px;
	top:0px;
}
 img{
	width:206px;
	height:100px;
	float:left;
}

</style>


</head>

<body>
<div id="container">
<div id="div1"><img src="image1.jpg" ><img src="image2.jpg"><img src="image3.jpg"></div>
<div id="div2"><img src="image4.jpg" ><img src="image5.jpg"><img src="image6.jpg"></div>
</div>
<script>scroll();</script>
<script>
var m=0;
var n=620;
function scroll(){
	document.getElementById("div1").style.left =m +"px";
	document.getElementById("div2").style.left =n +"px";
	m--;
    n--;
	
	if(m==-620)
	     {m=620;}
	if(n==-620)
	{n=620;}	
     

}
setInterval (scroll,10); 
</script>
</body>
</html>