twitter-bootstrap – 仅当用户点击关闭图像时如何关闭Bootstrap
发布时间:2020-12-18 00:09:58 所属栏目:安全 来源:网络整理
导读:当用户点击关闭btn时,我想关闭模式。正如我所看到的,我需要从modal.js覆盖这部分代码: hide: function (e) { e e.preventDefault() var that = this e = $.Event('hide')//if I delete this line modal won't hide this.$element.trigger(e) if (!this.is
当用户点击关闭btn时,我想关闭模式。正如我所看到的,我需要从modal.js覆盖这部分代码:
hide: function (e) { e && e.preventDefault() var that = this e = $.Event('hide')//if I delete this line modal won't hide this.$element.trigger(e) if (!this.isShown || e.isDefaultPrevented()) return this.isShown = false $('body').removeClass('modal-open') escape.call(this) this.$element.removeClass('in') $.support.transition && this.$element.hasClass('fade') ? hideWithTransition.call(this) : hideModal.call(this) 我在正确的道路上吗? 解决方法
当您启动您的模式时,您可以传递选项:
{ keyboard: false,backdrop: 'static' } 这将禁用通过单击背景关闭模态和转义按钮。或者它们可以设置为数据属性。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |