Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collapse sets wrong height on accordion #2462

Closed
mikehaertl opened this issue Mar 8, 2012 · 14 comments
Closed

Collapse sets wrong height on accordion #2462

mikehaertl opened this issue Mar 8, 2012 · 14 comments
Labels
Milestone

Comments

@mikehaertl
Copy link

I use collapse() on a set of 12 accordion-group items, each with different heights. I didn't add in to any accordion-body. I see that collapse adds height:418px to the accordion container. This is way it cuts of several elements on the bottom. I tried to debug but could not really figure, why this height is set at all.

@mikehaertl
Copy link
Author

My workaround now was this: $('#accordion').collapse().height('auto');

@meshy
Copy link

meshy commented Mar 11, 2012

Seems related to #2274 and #2497.

@mikehaertl
Copy link
Author

Not sure if it's related. My content is not dynamic. It only has quite some different length in each group.

@meshy
Copy link

meshy commented Mar 12, 2012

Sorry, my mistake.

@fat
Copy link
Member

fat commented Mar 20, 2012

could you create a jsfiddle? thanks!

@thomalexandre
Copy link

I have an accordion, and while it is expanded, I populate the content with js. Unfortunately the content doesn't resize automatically. Is there a way to force the resize of the content.
If I collapse and expand again the block it is fine of course but I would like to have it automated.

@thomalexandre
Copy link

I found a workaround which works, and resize properly the height of the content
When I finish to populate the content of my block, I add this code

if($("#block").hasClass("in"))
$("#block").css('height', 'auto');

@mikehaertl
Copy link
Author

It seems this issue is gone in 2.0.2. I could only reproduce it in 2.0.1.

@fat
Copy link
Member

fat commented Apr 15, 2012

oh great - closing then, thanks!

@fat fat closed this as completed Apr 15, 2012
@jameskleeh
Copy link

I'm having this issue with 2.0.2!

@petelopez
Copy link

Same here, having this issue as of right now in 2.0.3. There is a fix from philBrown over at Issue #2131.

@BenjiZombie
Copy link

Using 2.0.3 with dynamic content.

I found the problem. There are 2 calls to the member function 'transition' in the code.

In function 'show', it (line #69) should be like:
this.transition('addClass', $.Event('show'), $.Event('shown'))

In function 'hide', it (line #78) should be like:
this.transition('removeClass', $.Event('hide'), $.Event('hidden'))

Finally, in the 'transition' function, line #98 should be like:
if (startEvent.type == 'show') that.reset()

BenjiZombie

@BrandonCopley
Copy link

I am having this issue as well, adding .height('auto') fixed this for me. I am on 2.2.2

@aroc
Copy link

aroc commented Mar 5, 2013

The .height('auto') works me as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants