Modal animates only on the first hide()
When hiding the modal using
<input id="close" class="btn" type="button" value="Close" onclick="$('#modal').modal('hide');" />
The modal hides with animation, but after showing the modal again:
$('#modal').modal('show');
}
the modal does not hide with animation. The hide animation always works when pressing escape.
hm... can you create a jsfiddle demonstrating this problem? thanks!
Hi fat,
This is similar code that I use.
http://jsfiddle.net/cm3gx/
It appears to be working on jsfildde, but I will try to further explain what happens on my end.
I am using the latest bootstrap-modal.js and the latest bootstrap css.
When clicking 'Close' I am experiencing the class 'in' gets removed and display: none; is set at the exact same time from the modal div. (Causing the animation not to occur)
But when I hit ESC, 'in' is removed first (Showing the animation), then display: none; is set after the animation occurs. On the modal div.
hm... well it seems like the problem isn't related to boostrap if it's working in jsfiddle but not in you dev environment... could you reopen with a breaking example - thanks!
I've been experiencing the same bug, and have narrowed it down to Prototype.js. If Prototype is loaded on the page, then the modal does not animate when dismissing.
I think this is more of an issue with Prototype being "helpful" than an error in Bootstrap though.
Example: http://jsfiddle.net/lachlan/4ySsc/