insaidd,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
li{
margin: 0px;
width: 100px; height:50px; float: left;
display: block;
}
#carusel {
position:relative; top: 0px; left:0px; display:block;
height:50px;
padding: 0px; margin: 0px;
}
div{
overflow:hidden; width: 200px; height:50px; position: relative; margin: 100px auto;
}
</style>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script>
$(function () {
$(function() {
var ul = $('#carusel'), widthAll = 0;
$('li', ul).each(function(indx, element){
widthAll += this.offsetWidth
});
ul.width(widthAll);
function go() {
var li = $('li:first', ul), w = li.width();
ul.delay(3000).animate({
left: -w
}, 2000, function () {
li.appendTo($(this))
$(this).css({
left: '0px'
});
go()
})
}
go()
});
})
</script>
</head>
<body>
<div>
<ul id="carusel">
<li id = "1" style="background-color:red;">1</li>
<li id = "2" style="background-color:green;width: 120px;">2</li>
<li id = "3" style="background-color:Yellow;width: 70px; ">3</li>
<li id = "4" style="background-color:DeepPink;">4</li>
<li id = "5" style="background-color:MediumBlue;">5</li>
</ul>
</div>
</body>
</html>