// JavaScript Document var leftCt = 0; $(function(){ $("#album").attr("top", "0"); imgStart("R"); }); function imgStart(tp){ clearInterval($("#photolist").attr("timer")); if(tp == "R"){ // 오른쪽 이동 imgRight(); $("#photolist").attr("timer", setInterval("imgRight()", 80000)); // 멈춰있는 시간 }else{ // 왼쪽이동 if(leftCt == 0){ var leng = $("#photolist div").size(); $("#photolist").css("left",parseInt($("#photolist div").eq(0).width()*-1)); $("#photolist>div").eq(parseInt(leng-1)).clone().prependTo($("#photolist")); $("#photolist>div").eq(leng).remove(); leftCt = 1; } imgLeft(); $("#photolist").attr("timer", setInterval("imgLeft()", 80000)); } } function imgRight(){ $("#photolist").animate({ left : parseInt($("#photolist div").eq(0).width() * -1) },300,function(){ $("#photolist").css("left", "0px"); $("#photolist>div").eq(0).clone().appendTo($("#photolist")); $("#photolist>div").eq(0).remove(); }); } function imgLeft(){ var leng = $("#photolist div").size(); $("#photolist").animate({ left : 0 },300,function(){ $("#photolist").css("left", "0px"); $("#photolist").css("left",parseInt($("#photolist div").eq(0).width()*-1)); $("#photolist>div").eq(parseInt(leng-1)).clone().prependTo($("#photolist")); $("#photolist>div").eq(leng).remove(); }); }