可拖动元素上的jQuery手风琴,可拖动高度不会自动调整大小 [英] jquery accordion on draggable element, height of draggable not auto resize

查看:131
本文介绍了可拖动元素上的jQuery手风琴,可拖动高度不会自动调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在可拖动元素上使用jquery手风琴,将元素拖动后,当其内部的手风琴折叠时,其高度不会自动调整大小.

I am using jquery accordion on draggable element, after the element dragged, its height is not autoresized when the accordion inside it is collapsed.

这是什么问题?

推荐答案

从我发现这似乎是一个反复出现的问题,拖动后容器高度不会设置为自动".

From what I could find this seems to be a recurring issue, the container height won't be set back to 'auto' after dragging.

错误"显然是Firefox确实遵守的CSS规范的限制;可以在这里找到很多细节和jsfiddle示例: http://bugs.jqueryui.com/ticket/10725

The 'bug' is apparently a limitation of the CSS spec that Firefox does comply with; quite some details and jsfiddle examples can be found here: http://bugs.jqueryui.com/ticket/10725

到目前为止,我的解决方案是在需要时自行将高度设置为自动":

My solution so far is to set the height to 'auto' myself when needed:

$('#container').css({height; 'auto'});

这当然是不雅的,并且您必须在容器中的每个动态内容更改之后编写它.仍然可以使您的代码正常工作,直到添加选项为止(按照 http://bugs.jqueryui.com/ticket/3011 ).

Of course this is inelegant, and you have to write it after every dynamic content change in your container. Still it makes your code work until an option is added (follow http://bugs.jqueryui.com/ticket/3011 for that).

欢呼

这篇关于可拖动元素上的jQuery手风琴,可拖动高度不会自动调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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