diff --git a/js/dropdown.js b/js/dropdown.js index 9874600f9d..5e6cefe843 100644 --- a/js/dropdown.js +++ b/js/dropdown.js @@ -34,7 +34,10 @@ if (!isActive) { if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { // if mobile we use a backdrop because click events don't delegate - $('
').insertAfter($(this)).on('click', clearMenus) + $(document.createElement('div')) + .addClass('dropdown-backdrop') + .insertAfter($(this)) + .on('click', clearMenus) } var relatedTarget = { relatedTarget: this } diff --git a/js/modal.js b/js/modal.js index c1eb2a852b..b031becfd5 100644 --- a/js/modal.js +++ b/js/modal.js @@ -190,7 +190,8 @@ if (this.isShown && this.options.backdrop) { var doAnimate = $.support.transition && animate - this.$backdrop = $('') + this.$backdrop = $(document.createElement('div')) + .addClass('modal-backdrop ' + animate) .appendTo(this.$body) this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {