固定位置 div 仅垂直
我当前的网络构建有一个固定位置的右侧边栏。我尝试从右侧定位,但不希望它与其他 div 内容重叠。
我正在寻找的是当内容在视口窗口之外时可以水平向右滚动。任何帮助将不胜感激。
与此类似:http://demo.rickyh.co。 uk/css-position-x-and-position-y/ 但是我无法让它工作。
这已通过替代方法解决。感谢那些真正考虑提供帮助的人。
I have a current web build with a right sidebar that is a fixed position. I have tried to positioning from the right but don't want it overlapping other divs content.
What I am looking for is to have the content scrollable horizontally to the right when it is out of the viewport window. Any help would be greatly appreciated.
similarly to this: http://demo.rickyh.co.uk/css-position-x-and-position-y/ however I can not get this working.
This has been solved by alternative method. Thanks for those who actually considered helping.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
保持固定div。
并有以下 javascript 代码来处理水平移动。
Keep the fixed div.
And have the following javascript code which will take care of horizontal moving.
然后在#sidebar 中添加一个属性
then add one more property in #sidebar
该示例网站不仅仅使用 CSS 来产生这种效果。它还使用 MooTools 插件:ScrollSpy。 http://davidwalsh.name/mootools-scrollspy
查看源代码 http://demo.rickyh.co.uk/css-position-x-and-position- y/ 查看脚本和完整的 CSS。
That example site is using more than just css to generate that effect. It is also using a MooTools plugin: ScrollSpy. http://davidwalsh.name/mootools-scrollspy
View the source at http://demo.rickyh.co.uk/css-position-x-and-position-y/ to see the scripting and the full css.