Ale*_*nik 13 javascript jquery twitter-bootstrap
我只是调试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)
Run Code Online (Sandbox Code Playgroud)
我的问题是关于以下几行:
emulateTransitionEnd(Modal.TRANSITION_DURATION) :
Run Code Online (Sandbox Code Playgroud)
那是什么?一个jQuery函数?引导程序中的自定义函数?
我搜索了这个函数,但几乎找不到任何东西,我猜这是一个自定义引导函数.但是我根本没有在modal.js(bootstrap.js的子集)中看到这个函数.
我在某处看到了以下内容:链接.
这究竟是emulateTransitionEnd什么?它在哪里定义,它在做什么?
你可以在这里找到我正在谈论的那一行:第99行modal.js
Die*_*tto 11
这是在此声明的自定义Bootstrap函数
https://github.com/twbs/bootstrap/blob/83bfff7f0765503b990b96c303eef67009e48d77/js/transition.js#L36
它是一个在$ .support.transition.end上触发事件(一次)的函数
$ .support.transition.end包含以下事件之一:
您可以在此处找到更多信息