diff --git a/docs/javascript.html b/docs/javascript.html index 61b0c8dc02..9f153c0bf6 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -12,7 +12,7 @@ - + diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js index 8b0ac2d02f..4201d843c2 100644 --- a/js/bootstrap-modal.js +++ b/js/bootstrap-modal.js @@ -85,11 +85,13 @@ .appendTo(document.body) .show() - setTimeout(function () { - that.$element - .addClass('in') - .trigger('shown') - }, 0) + if ($.support.transition && that.$element.hasClass('fade')) { + that.$backdrop[0].offsetWidth // force reflow + } + + that.$element + .addClass('in') + .trigger('shown') }) return this @@ -132,6 +134,8 @@ var that = this , animate = this.$element.hasClass('fade') ? 'fade' : '' if ( this.isShown && this.settings.backdrop ) { + var doAnimate = $.support.transition && animate + this.$backdrop = $('