$(document).ready(function() {
var timer = null;
var pic = $(".pic");
var oUl = pic.children("ul");
var aImg = pic.find("img");
var imgWidth = parseFloat(pic.css("width")) || pic.prop("offsetWidth");
oUl.css("width", imgWidth * aImg.length + 'px');
var i = 0;
timer = setInterval(function() {
oUl.animate({
"left": "-" + imgWidth + 'px'
}, 500, function(){
oUl.children("li:first").insertAfter(oUl.children("li:last"));
oUl.css("left", 0);
});
}, 1000);
});