alademann / bootstrap

This project has been superceeded by an official Bootstrap Sass port. Please use: https://github.com/twbs/bootstrap-sass
Apache License 2.0
185 stars 29 forks source link

Collapse Animation - On Opening #3

Closed Ne-Ne closed 11 years ago

Ne-Ne commented 11 years ago

Hey,

As the title states, I have a problem that the animation on opening. It is not the same as on close. Is it possible to use the function to allow to be used for opening animation. Not just the closing?

I want the UI to be the same as content being opened and closed across the site.

Great work on BS3 by the way!

alademann commented 11 years ago

Thanks for the bug report. I will address this as part of the 3.0.1 release.

Ne-Ne commented 11 years ago

Thanks, I can see there is a function that does the animation. However I need a fix?

I have a feeling that max-height may work. What would you recommend?

alademann commented 11 years ago

@Ne-Ne - If your HTML markup is compliant with all the requirements shown in twbs' documentation about the collapse plugin, and you don't have any custom CSS affecting the height/max-height/etc... it should just work.

Ne-Ne commented 11 years ago

Thanks for replying @alademann . I missed there was a conflict between my JS and the transition.js file.

However I have set the HTML5 Data attr to collapse. However on document load the animation starts (opened -> closed) on every container. I would like the containers to be closed then apply the click toggle to the accordion.

-Neil

alademann commented 11 years ago

@Ne-Ne clicking on them doesn't toggle their visibility?

Ne-Ne commented 11 years ago

On page load they collapse straight away.

Don't get me wrong the animation (on toggle works fine), but as I have a lot of content within the accordion, as the initial random collapse look obvious.

Using the data attr does this enforce the collapsed element on load or is there a natural delay?

alademann commented 11 years ago

The data attribute is hooked into the collapse plugin on domReady I believe - so you would need to hard-code a css class on the containers that are present at time of load that hide that content before the collapse occurs.

Ne-Ne commented 11 years ago

That makes sense however I checked the CSS and there is height 0px and overflow hidden (I believe).

Without looking to be a pain in the arse. Would this negate the need for a hardcoded class?

Many thanks

Sent from my iPhone

On 5 Sep 2013, at 20:58, Aaron Lademann notifications@github.com wrote:

The data attribute is hooked into the collapse plugin on domReady I believe - so you would need to hard-code a css class on the containers that are present at time of load that hide that content before the collapse occurs.

— Reply to this email directly or view it on GitHub.

alademann commented 11 years ago

Neil,

Please post an example / link to the behavior you're seeing.

Ne-Ne commented 11 years ago

I'm working off Mamp Pro, will get a copy on a subdomain in the morning (uk).

Thanks for looking into this.

Sent from my iPhone

On 5 Sep 2013, at 21:18, Aaron Lademann notifications@github.com wrote:

Neil,

Please post an example / link to the behavior you're seeing.

— Reply to this email directly or view it on GitHub.