$("#element").offset().top
var scrollTop = $(window).scrollTop(), elementOffset = $('#my-element').offset().top, distance = (elementOffset - scrollTop);