【发布时间】:2015-04-29 11:09:44
【问题描述】:
我只是在调试 modal.js 并遇到以下代码:
that.$element.find('.modal-dialog') // wait for modal to slide in
.one('bsTransitionEnd', function () {
that.$element.trigger('focus').trigger(e)
})
.emulateTransitionEnd(Modal.TRANSITION_DURATION) :
that.$element.trigger('focus').trigger(e)
我的问题是关于以下行:
emulateTransitionEnd(Modal.TRANSITION_DURATION) :
那是什么?一个jQuery函数? bootstrap 中的自定义函数?
我用谷歌搜索了这个函数,但几乎找不到任何东西,我猜它是一个自定义引导函数。但是我在我的 modal.js(bootstrap.js 的一个子集)中根本看不到这个函数。
我在某处看到以下内容:link。
emulateTransitionEnd 到底是什么?它在哪里定义,它在做什么?
你可以在这里找到我说的那一行:line 99 modal.js
【问题讨论】:
-
丢失了 grep 副本? github.com/twbs/bootstrap/blob/…
-
@cvrebert,好的,所以我只有 Jquery 和 modal.js,我正在制作一个模态,我没有 transition.js,我的 cosnole 没有显示任何错误!为什么???
-
如果不加载transitions模块,那么
$.support.transition将是未定义的,所以transitions will merely be disabled -
所以给出以下声明
$.support.transition && this.$element.hasClass('fade') ? this.$backdrop .one('bsTransitionEnd', callbackRemove) .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : callbackRemove()。 callbackRemove() 将触发,如果我不包括 transitions.js ??
标签: javascript jquery twitter-bootstrap