diff --git a/1.3.0/bootstrap-modal.js b/1.3.0/bootstrap-modal.js index da670607..d3e293ca 100644 --- a/1.3.0/bootstrap-modal.js +++ b/1.3.0/bootstrap-modal.js @@ -89,7 +89,7 @@ that.$element .addClass('in') .trigger('shown') - }, 1) + }, 0) }) return this @@ -133,15 +133,19 @@ , animate = this.$element.hasClass('fade') ? 'fade' : '' if ( this.isShown && this.settings.backdrop ) { this.$backdrop = $('
') - .click($.proxy(this.hide, this)) .appendTo(document.body) + if ( this.settings.backdrop != 'static' ) { + this.$backdrop.click($.proxy(this.hide, this)) + } + setTimeout(function () { that.$backdrop && that.$backdrop.addClass('in') $.support.transition && that.$backdrop.hasClass('fade') ? that.$backdrop.one(transitionEnd, callback) : callback() - }) + }, 0) + } else if ( !this.isShown && this.$backdrop ) { this.$backdrop.removeClass('in') diff --git a/javascript.html b/javascript.html index 5c52e930..cd05a723 100644 --- a/javascript.html +++ b/javascript.html @@ -101,9 +101,9 @@"static" if you do not want the modal closed when the backdrop is clickedYou can activate modals on your page easily without having to write a single line of javascript. Just give an element a data-controls-modal attribute which corresponds to a modal element id, and when clicked, it will launch your modal. To add modal options, just include them as data attributes as well.
-<a class="btn" data-controls-modal="my-modal" data-backdrop="true" >Launch Modal</a> +<a class="btn" data-controls-modal="my-modal" data-backdrop="static" >Launch Modal</a>
Notice If you want your modal to animate in and out, just add a .fade class to your .modal element (refer to the demo to see this in action).