On an internet browser, I would like to have a div (typically a menu or an information bar) that stops moving when reaching the top of the screen during a page scroll. Note that I do not whant this ‘div’ to be stuck at one position all the time : It is a normal ‘div’ that follows page scrolling except when reaching the top of the screen.
I am not sure it can be done only with css, if not, may be you could help me with jquery…
On an internet browser, I would like to have a div (typically a menu
Share
You can use jquery waypoints to help you out with this http://imakewebthings.github.com/jquery-waypoints/sticky-elements
With waypoints you can listen in on window scroll events an optionally change the css dynamically to position:fixed when that div hits the top of your screen when you start scrolling down and vice versa when it gets back to its original position when scrolling up.