div shifting between position:fixed and position:absolute during scrolling
I am looking for a way to imitate the behaviour of the menu to the left on this website: http://www.nectarboutique.com/collections/on-sale
Meaning: I need a div that has to be absolutely positioned (CSS styled) somewhere close to the top of the page, until the user scrolls down beyond a certain point, and then it changes to position: fixed
. Then, wh开发者_高级运维en it reaches somewhere near the bottom (before it intersects with the footer), it has to change back to position: absolute
.
This would be a big help to me, if anyone knows a solution?
They are using a custom jQuery code. See a good tutorial on how to do this here: http://css-tricks.com/scrollfollow-sidebar/
Or you could download a jQuery plugin to help you on your way: http://plugins.jquery.com/node/8152
精彩评论