Commit 270316f1 authored by liuyl's avatar liuyl
Browse files

fix transition end

parent b1a1210f
1 merge request!8774fix transition end
Showing with 5 additions and 5 deletions
+5 -5
...@@ -50,8 +50,8 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") } ...@@ -50,8 +50,8 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
// http://blog.alexmaccaw.com/css-transitions // http://blog.alexmaccaw.com/css-transitions
$.fn.emulateTransitionEnd = function (duration) { $.fn.emulateTransitionEnd = function (duration) {
var called = false, $el = this var called = false, $el = this
$(this).one('webkitTransitionEnd', function () { called = true }) $(this).one($.support.transition.end, function () { called = true })
var callback = function () { if (!called) $($el).trigger('webkitTransitionEnd') } var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
setTimeout(callback, duration) setTimeout(callback, duration)
return this return this
} }
......
This diff is collapsed.
...@@ -43,8 +43,8 @@ ...@@ -43,8 +43,8 @@
// http://blog.alexmaccaw.com/css-transitions // http://blog.alexmaccaw.com/css-transitions
$.fn.emulateTransitionEnd = function (duration) { $.fn.emulateTransitionEnd = function (duration) {
var called = false, $el = this var called = false, $el = this
$(this).one('webkitTransitionEnd', function () { called = true }) $(this).one($.support.transition.end, function () { called = true })
var callback = function () { if (!called) $($el).trigger('webkitTransitionEnd') } var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
setTimeout(callback, duration) setTimeout(callback, duration)
return this return this
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment