Saturday 15 September 2012

javascript - Affect element when scrolled down -


I have & lt; Div & gt; , whose CSS features I want to change whenever I scroll down to 10px of the website, how can I do this?

About something like this:

  $ (document) ) .ready (function () {$ (window) .scroll (function () {var elementTop = $ ('. SomeDiv') offset () top; var position = elementTop- $ (window) ScrollTop (); if ( Condition == 10) {// do something}});});   

I think it can work, I have not tested it yet, but try it ..

In addition to this jquery function actually Should be helpful, you also see:

No comments:

Post a Comment