SAMPLE01…背景画像を繰り返しエンドレスに横移動
ソースコード
$(function(){ $("#sample01").css("background-position" , "0% bottom"); var scrollSpeed = 1;//px 移動する量 var imgWidth = 500;//画像の幅 var posX = 0;//背景のスタート位置 setInterval(function(){ if(posX >= imgWidth){ posX = 0; } posX += scrollSpeed; $("#sample01").css("background-position" , posX+"px bottom") } , 50); });