开发者

div shifting between position:fixed and position:absolute during scrolling

开发者 https://www.devze.com 2023-01-30 19:42 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号