可滚动的弹出菜单

发布于 2024-08-14 00:07:43 字数 145 浏览 4 评论 0原文

我正在尝试创建一个弹出菜单,如果它比屏幕大,则内置滚动菜单。我似乎无法弄清楚如何使用本机溢出-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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

樱花落人离去 2024-08-21 00:07:43

这不是我的解决方案,但您可以尝试这个..它具有非常好的效果并满足您的目的:

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//

相思碎 2024-08-21 00:07:43

你应该为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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文