jQuery UI 手风琴问题
我使用 jQuery UI 手风琴小部件,每个项目之间都有一些空间。问题是,在 IE 8 中,当您滑动某个项目时,它可以很好地滑动,但会消除它与向上的项目之间的空间。不过,它在 FF 和其他浏览器中运行良好。
然而,当我将鼠标悬停在该项目上时,它会创建该空间。
我使用 HTML5 文档类型,但它也不适用于其他文档类型。
谢谢。
编辑:这是一个实例。
I use the jQuery UI accordion widget, and between every item I have some space. The issue is that in IE 8 , when you slide an item, it slides fine, but it removes the space between it and the upward item. It works good in FF and other browsers, though.
When I over with the mouse on that item, though, it creates that space.
I use the HTML5 doctype, but it doesn't work with others doctypes either.
Thanks.
Edit: Here's a live example.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试将
margin-bottom:5px;
应用于.ui-accordion-header
。这将导致打开的标头与其内容之间出现间隙,但您可以通过删除
.ui-accordion-header.ui-state-active
上的边距并将其应用到来修复该问题。 ui-accordion-content-active
相反。所以你的 css 看起来像这样:
.ui-accordion-header {
下边距:5px;
}
.ui-accordion-header.ui-state-active {
下边距:0;
}
.ui-accordion-content-active {
下边距:5px;
}
这可能需要一些调整,但应该可以让你大部分完成。
Try applying
margin-bottom:5px;
to.ui-accordion-header
.This will cause a gap between the open header and it's content, but you can fix that by removing the margin on
.ui-accordion-header.ui-state-active
and applying it to.ui-accordion-content-active
instead.So your css would look like this:
.ui-accordion-header {
margin-bottom:5px;
}
.ui-accordion-header.ui-state-active {
margin-bottom:0;
}
.ui-accordion-content-active {
margin-bottom:5px;
}
That might need a bit of tweaking, but should get you mostly there.
我遇到了同样的问题,这是一个奇怪的错误,仅当应用边距的元素的方向是从右到左时才会发生。对我有用的解决方案是给它
direction: ltr
,然后将direction: rtl
应用于它的后代。再说一次,我不知道这是为什么,但如果我尝试了解微软,我会自杀。这对我来说是一个幸运的猜测,我希望它对其他人有帮助。
I had the same issue, it is a weird bug that only happens when the direction of the element the margin is applied to is right to left. The solution that worked for me is to give it
direction: ltr
and then applydirection: rtl
to it's descendents.Again, I have no idea whatsoever why this is, but if i'd try and understand microsoft i'd kill myself. It was a lucky guess on my part, and I hope it helps someone else.