$(function(){ $('html').css('font-size',$(document).width() >= 750 ? '100px' : $(document).width() / 750 * 100 + 'px'); var index = 1; function toRun(){ if (index == 2) index = 0; $('#ky .steps3-container ul').animate({ left:-index * $('#ky .steps3-container').width() + 'px' }) index +=1; $("body").css("opacity",1); } setInterval(toRun,100) })