lundi 1 décembre 2014

...scrollTop($(this)...)


I have a few divs with the .class class whose scroll position is defined by another child of its parent, so I need to assign a scrollTop() with $(this), something like



$(".class").scrollTop($(this).parent().find('.child').scrollTop());


But that code doesn't work...



$(".class").scrollTop(
function(){
$(this).parent().find('.child').scrollTop()
}
);


Doesn't work either. Any clue?





Aucun commentaire:

Enregistrer un commentaire