使 div 向下滑动而不向下推内容
i have an exampe HERE
im not sure how to make the div slide down but keeping the content at the top, as in not slide down when the div slides down.
could you possibly help me with this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你的意思是类似这样吗?
http://jsfiddle.net/yGZHC/3/
如果是这样,请使用
position:absolute
。这样元素的位置就不会影响其他元素的位置。编辑:根据您想要执行的操作,
relative
可能会更好。http://jsfiddle.net/yGZHC/5/
编辑2:甚至更好的是,动态使用高度来确定如何远距离移动内容。这样你就不会被限制在固定的高度。
http://jsfiddle.net/yGZHC/7/
Do you mean sort of like this?
http://jsfiddle.net/yGZHC/3/
If so, use
position:absolute
. This way the position of the element does not affect the position of other elements.EDIT: Depending on what you're trying to do,
relative
may be better.http://jsfiddle.net/yGZHC/5/
EDIT2: And even better than that, use the height dynamically to determine how far to move the content. This way you're not constrained to a fixed height.
http://jsfiddle.net/yGZHC/7/
我将其修复为我认为您所要求的。
http://jsfiddle.net/yGZHC/2/
首先,将内容移到内容下方如果您想名列前茅:
然后,只需将您的
slidenav
调高一些即可进行补偿。如果需要,您甚至可以完全隐藏 div,直到单击显示按钮。I fixed it to what I think you are asking for.
http://jsfiddle.net/yGZHC/2/
First thing's first, move the content below the stuff you want to be on top:
Then, just bump your
slidenav
up some more to compensate. You could even hide the div completely until the show button is clicked if you want.