使占位符 div 可动态重叠
我使用 jQuery UI 手风琴作为页面右侧的菜单。但是,有时菜单会比左侧的内容高。因此,当展开/收缩手风琴部分时,浏览器上的滚动条会在打开手风琴部分时增大/缩小。我的想法是在手风琴下方有一个 div,这是手风琴可能达到的高度,当手风琴展开时,它只会与它重叠,因此根本不会改变浏览器上的滚动条(希望这是有道理的)。给它一个位置:绝对并声明高度和宽度似乎会搞乱布局,将其放置在页脚上方但在其下方流血。有人对如何实现这项工作有任何想法吗?如果您需要更详细的示例,我会看看我能做些什么来提供它,但是,该网站已被锁定,我无法给出用户名/密码。
I'm using a jQuery UI accordion as a menu on the right side of a page. However, there are occasions where the menu will be taller than the content on the left. Because of this, when expanding/contracting sections of the accordion, the scrollbar on the browser can grow/shrink when opening a section of the accordion. My thought was to have a div below the accordion which is the height that the accordion could possibly get to, and when the accordion expands it would just overlap it, thus not changing the scrollbar on the browser at all (hope that makes sense). Giving it a position: absolute and declaring the height and width seems to screw up the layout, placing it overlapping the footer but bleeding below it. Anyone have any ideas on how to make this work? If you need a more detailed example, I'll see what I can do to provide it, however, the site is locked down and I can't give out a username/password.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Min-height 在 IE 6 中很容易实现。
来自达斯汀·迪亚兹 (Dustin Diaz) 的最古老的黑客:
或者用表达式:
事实上,对于 IE 6 高度就像 min-height。元素将随着其中的内容展开,直到指定了
overflow:hidden
。您始终只能使用“* html hack”或条件注释来应用 IE 6 的规则。
Min-height is easy to implement in IE 6.
The oldest hack from Dustin Diaz:
Or with expressions:
In fact for IE 6 height is like min-height. Element will expand with the content in it, until there is
overflow:hidden
specified..You can always apply rules for IE 6 only with "* html hack" or with Conditional Comments.
您可能在菜单和内容周围有一个容器,对吧?您可以向容器添加一个 css min-height ,该高度等于菜单的最高高度
You probably have a container around the menu and the content right? You could add a css min-height to the container which would be equal to the tallest that the menu could be in height