当前位置: 动力学知识库 > 问答 > 编程问答 >

html - How to make an object follow the screen on scroll?

问题描述:

Okay, that was a pretty ambiguous title, but in essence, this is what I want to be able to do: have an object start out at x, y and not move until the document has scrolled so much that the object is at the top of the screen. Then, I want it to behave exactly like an object with the position:fixed; property set. In other words, I want it to behave like the StackOverflow sidebar when you ask a new question: until the sidebar reaches the top of the screen, it stays put. After that, it follows you.

分享给朋友:
您可能感兴趣的文章:
随机阅读: