jQuery UI 手风琴问题

发布于 2024-09-09 06:21:14 字数 459 浏览 2 评论 0原文

我使用 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. alt text

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 技术交流群。

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

发布评论

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

评论(2

打小就很酷 2024-09-16 06:21:14

尝试将 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.

盛夏尉蓝 2024-09-16 06:21:14

我遇到了同样的问题,这是一个奇怪的错误,仅当应用边距的元素的方向是从右到左时才会发生。对我有用的解决方案是给它 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 apply direction: 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.

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