jquery - execute code on scrolling down an element -
i using http://cubiq.org/dropbox/iscroll4/examples/simple/ in web page i'm developing , exceute code user scrolls/drags down, example text within specific row should fade in user scrolls down. though use this:
$(window).on('scroll', function() { var st = $(this).scrolltop(); $( 'li.frame1 img' ).css({ 'top' : -(st/3)+"px", 'left' : -(st/3)+"px" }); });
but user scrolling down element #scroller
, not window. how adapt or achieve i'm trying do?
thanks!
$("#scroller").on('scroll', function() { var st = $(this).scrolltop(); $( 'li.frame1 img' ).css({ 'top' : -(st/3)+"px", 'left' : -(st/3)+"px" }); });
replacing document
"#scroller"
should job.
Comments
Post a Comment