jqueryaccordionjquery-draggable

jquery accordion on draggable element, height of draggable not auto resize


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

What's the problem here?


Solution

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

    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'});
    

    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).

    Cheers