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

查看:28
本文介绍了可拖动元素上的 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天全站免登陆