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

Popular posts from this blog

java - HTTP Status 500 - An exception occurred processing JSP page /second.jsp at line 15 -

php - Using str_replace to translate a MySQL Table in html -

asp.net mvc - Cannot display error message on Editor or EditorFor -