팁/튜토리얼

간단한 롤링배너 jQuery

2015.08.03 15:48
6,801
2

http://codepen.io/eond/pen/XboxoZ

 

slidetimer();
var current=0;
var $interval;
function slidetimer(){
  var $interval=setInterval(function(){slide()},3000);               }
function slide(){
  $("ul").animate({left:"-=100px"},700,function(){
    $(this).css({"left":0});

    $("ul").append( $("ul").children("li").eq(0) );
  });   
  current++;
  if(current==5)current=0;
}

eond Lv. 12

댓글 2