javascript - ...scrollTop($(this)...) -


i have few divs .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

Popular posts from this blog

c++ - OpenMP unpredictable overhead -

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

javascript - Wordpress slider, not displayed 100% width -