gpt4 book ai didi

twitter-bootstrap - 如何仅在用户单击关闭图像时关闭 Bootstrap 模式?

转载 作者:行者123 更新时间:2023-12-03 07:28:38 27 4
gpt4 key购买 nike

我只想在用户单击关闭按钮时关闭模式。正如我所见,我需要覆盖 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)

我走的路正确吗?

最佳答案

您可以定义模态行为,定义数据键盘和数据背景。

 <div id="modal" class="modal hide fade in" data-keyboard="false" data-backdrop="static">

关于twitter-bootstrap - 如何仅在用户单击关闭图像时关闭 Bootstrap 模式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12669607/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com