具有autoHeight = true的jQuery UI手风琴在非默认窗格上具有不必要的滚动条 [英] jQuery UI accordion with autoHeight=true has unnecessary scrollbar on non-default panes

查看:82
本文介绍了具有autoHeight = true的jQuery UI手风琴在非默认窗格上具有不必要的滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用jQuery手风琴时遇到麻烦.当我创建一个内容窗格时,非默认窗格的内容比默认窗格多,并且autoHeight为true,这在切换窗格时提供了很好的动画效果,但是非默认窗格会得到我不想要的滚动条.

您可以通过转到 http://jqueryui.com/themeroller/来查看实际运行情况设置为"Blitzer"或"Humanity"之类的主题,然后打开示例手风琴的第3节.发生在Safari 3.2.1和Firefox 3.0.8中.

如果切换到autoHeight = false,则不会发生这种情况,并且所有内容窗格的高度都正确,但是内容窗格仅在动画结束时呈现,并且看起来很奇怪,因此我不得不将动画关闭为避免这种陌生感.

我误读了一些内容,或者这是jQuery UI手风琴中的错误.请帮我弄清楚是两者中的哪一个(或可能两者都有).

解决方案

我尝试了几种不同的方法. autoHeight:本身为false无效.这终于对我有用:

$( "#accordion" ).accordion({
            heightStyle: "content",
            autoHeight: false,
        clearStyle: true,   
        });

我在具有固定宽度的SharePoint内容编辑器Webpart中使用它,当向手风琴小部件添加内容时,这会增加高度问题.

I am having trouble with jQuery accordion. When I create a content pane where the non-default pane has more content than default pane, and autoHeight is true, this provides nice animations when switching panes, but the non-default pane gets a scrollbar which I don't want.

You can see this in action by going to http://jqueryui.com/themeroller/, switching to a theme like "Blitzer" or "Humanity", and then opening Section 3 of the example accordion. Happens to me with Safari 3.2.1 and Firefox 3.0.8.

If you switch to autoHeight=false, then this does not happen and all content panes have the correct height, but the content pane is only rendered at the end of the animation and looks strange, so I had to turn off animations to avoid this strangeness.

Either I am misreading something, or this is a bug in jQuery UI accordion. Please help me figure out which of the two it is (or maybe both).

解决方案

I tried several different things. autoHeight: false by itself did not work. This is what finally worked for me:

$( "#accordion" ).accordion({
            heightStyle: "content",
            autoHeight: false,
        clearStyle: true,   
        });

I'm using this in a SharePoint content editor webpart with a fixed width, which added to the height issue when adding content to the accordion widget.

这篇关于具有autoHeight = true的jQuery UI手风琴在非默认窗格上具有不必要的滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆