1
/* ========================================================================
2
* Bootstrap: transition.js v3.2.0
3
* http://getbootstrap.com/javascript/#transitions
4
* ========================================================================
5
* Copyright 2011-2014 Twitter, Inc.
6
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
* ======================================================================== */
13
// CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
14
// ============================================================
16
function transitionEnd() {
17
var el = document.createElement('bootstrap')
19
var transEndEventNames = {
20
WebkitTransition : 'webkitTransitionEnd',
21
MozTransition : 'transitionend',
22
OTransition : 'oTransitionEnd otransitionend',
23
transition : 'transitionend'
26
for (var name in transEndEventNames) {
27
if (el.style[name] !== undefined) {
28
return { end: transEndEventNames[name] }
32
return false // explicit for ie8 ( ._.)
35
// http://blog.alexmaccaw.com/css-transitions
36
$.fn.emulateTransitionEnd = function (duration) {
39
$(this).one('bsTransitionEnd', function () { called = true })
40
var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
41
setTimeout(callback, duration)
46
$.support.transition = transitionEnd()
48
if (!$.support.transition) return
50
$.event.special.bsTransitionEnd = {
51
bindType: $.support.transition.end,
52
delegateType: $.support.transition.end,
53
handle: function (e) {
54
if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)