javascript - ...scrollTop($(this)...) -
i have few div
s .class
class scroll position defined child of parent, need assign scrolltop()
$(this)
,
$(".class").scrolltop($(this).parent().find('.child').scrolltop());
but code doesn't work...
$(".class").scrolltop( function(){ $(this).parent().find('.child').scrolltop() } );
doesn't work either. clue?
this assuming reading question right. have mulitple "class" elements have own "child" elements. need use each set every element separately.
$(".class").each( function(){ var elem = $(this); var childsscrollposition = elem.parent().find('.child').scrolltop(); elem.scrolltop(childsscrollposition); } );
Comments
Post a Comment