Is there a way to collapse the the Bootstrap Collapse plugin from horizontally instead of vertically? Looking at the code this ability doesn’t seem to be built in, but I’m hoping I’m just missing something…
Any help will be greatly appreciated. Thanks!
I figured out how to do this very easily without modifying or adding any javascript.
First you define the following CSS after all Twitter Bootstrap CSS:
Next, on the target element (where you define the
.collapseclass) you need to add the class.widthor.heightdepending on what property you want to animate.Finally, you must wrap the contents of the target element and explicitly define its width if animating the width. This is not required if animating the height.
You can find a working example here -> http://jsfiddle.net/ud3323/ZBAHS/