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

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -