var i = 0; $("you_elemts").each(function(){ $(this).css("background-position", "0 " + i + "px" ); i += 150; })