jquery - returning the same Offset top value on a group of different divs -
i have this:
<div class="all"> <div class="first"></div> <div class="second"></div> <div class="third"></div> <div class="four"></div> </div>
and trying offset of divs inside "all".
i doing this:
$( ".all div" ).each(function( ) { var etop=$(this).offset().top; console.log(etop); $(window).scroll(function() { console.log(etop - $(window).scrolltop()); }); });
it returns same value 4 divs. think returning "scrolltop", not offset.
in css, has position:relative , child divs have position:relative well.
anyone can me?
thanks lot
Comments
Post a Comment