$(function(){ $('ul li').each(function(i){ var a=$(this).offset().top; console.log(a)}) })