可滚动的弹出菜单
我正在尝试创建一个弹出菜单,如果它比屏幕大,则内置滚动菜单。我似乎无法弄清楚如何使用本机溢出-y 滚动属性来做到这一点。每次我似乎设置了overflow-y:auto,那么飞出的菜单就会嵌套在带有滚动条的父div中。
有人有什么想法吗?
谢谢!
I'm trying to create a flyout menu that has scrolling build in if its larger than the screen. I can't seem to figure out how to do this with the native overflow-y scrolling properties. Everytime I seem to set that overflow-y:auto then the the menu that flys out is nested within the parent div with a scroll bar.
Anyone has any ideas?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这不是我的解决方案,但您可以尝试这个..它具有非常好的效果并满足您的目的:
http://css-tricks.com/examples/LongDropdowns//
This is not a solution of mine, but you can try this.. it has a really nice effect and serves your purpose:
http://css-tricks.com/examples/LongDropdowns//
你应该为div设置最大高度proparty,否则它无法告诉(因为它是绝对定位的)在哪里停止,或者你可以为旧浏览器设置高度,或者你可以用javascript编写它,动态改变高度直到它达到最大
you should set the max-height proparty for the div otherwise it cant tell (since it is sort of absolutely positioned) where to stop, or u can set the height for older browsers, or you can javascript it, change height dynamically until it reaches a maximum