I\'m trying to make modals pop up with info about certain places on a map. Here is the code:
IE so sad. But you can add tag
<meta http-equiv="X-UA-Compatible" content="IE=edge">
on after <html>
tag. It's will work.
And you should include only bootstrap.min.js. It's enough.
Here is another solution without modifying initial bootstrap layout and code:
var $modalWrapper = $('#modalWrapper');
$modalWrapper.on('show.bs.modal', function () {
$modalWrapper.toggleClass('in', true);
});
$modalWrapper.on('hidden.bs.modal', function () {
$('.modal-backdrop.fade').remove();
});
IE does not support the "fade" class for modals, by taking out fade i lost the animation, but the modal displays in all 3 browsers now. I found the answer here: https://github.com/twitter/bootstrap/issues/3672
You can include transition.js file instead of removing the fade class. This works fine for me with fade effect in IE10
I was also having same problem today. And after removing the fade class didn't work for me even. Thus, I further inspected and found an issue there. The bootstrap isn't able to add element.style{display:block;padding-right:12px;}
(here element means .modal) in IE. And after adding the following css worked fine:
.modal-open .modal {
display: block;
}
Note: I didn't need to remove the fade
class. And the animation is also working fine.
@scalen121 's answer worked for me (the fade
animation causes it to break). However, I had a problem with the suggested code fixes..
If you want to remove the fade
animation just for IE (it doesn't seem to work even on IE11) but leave it for other browsers, then you can add the snippet:
$(function () {
var isIE = window.ActiveXObject || "ActiveXObject" in window;
if (isIE) {
$('.modal').removeClass('fade');
}
});
Note that the above IE check is not the same as doing the old: $.browser.msie
, which returns undefined
on IE11 (tested with jQuery 1.8.3 and 1.7.2).