我只想在用户单击关闭 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)
我在正确的道路上吗?