jquery - Move an element when page is scrolled -
i want control various div elements upon page scroll, similar lamoulade.com.
i want 300px x 300px div move left right when scroll down, , right left when scroll up.
how can achieve that?
$(document).ready(function () { $(window).scroll(function () { if ($(this).scrolltop() > 100) { $('.scrollup').fadein(); } else { $('.scrollup').fadeout(); } }); }
here's common example makes scroll top button appear when page has been scrolled little. can use same technique make other changes dom / animation on screen scroll points.
Comments
Post a Comment