微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

javascript – emulateTransitionEnd在bootstrap.js中,它来自哪里?

嘿,我只是调试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函数?引导中的自定义函数? .

我讨厌这个功能,但几乎找不到任何东西,我猜测它的一个托管引导功能.但是在我的modal.js(bootstrap.js的一个子集)中我根本看不到这个功能.

我看到以下地方:link.

但我的问题真的是,这个emulatetransitionend是什么?它在哪里定义,它在做什么?

你可以在这里找到我所说的话:line 99 modal.js

解决方法

这是在这里声明的自定义Bootstrap函数

https://github.com/twbs/bootstrap/blob/83bfff7f0765503b990b96c303eef67009e48d77/js/transition.js#L36

这是一个在$.support.transition.end上触发事件(一次)的功能

$.support.transition.end包含以下事件之一:

> webkittransitionend
>转变
> otransitionend
otransitionend
>转变

你可以在这里找到更多的信息

how to listen to the end of a bootstrap animation

原文地址:https://www.jb51.cc/js/152807.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐