bootstrap-transition.js 1.91 KB
Newer Older
1
/* ===================================================
Jacob Thornton's avatar
Jacob Thornton committed
2
 * bootstrap-transition.js v2.0.2
Jon Stevens's avatar
Jon Stevens committed
3
 * http://twitter.github.com/bootstrap/javascript.html#transitions
4
 * ===================================================
Mark Otto's avatar
Mark Otto committed
5
 * Copyright 2012 Twitter, Inc.
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ========================================================== */

20
21

!function ( $ ) {
22

Jacob Thornton's avatar
Jacob Thornton committed
23
  $(function () {
Jacob Thornton's avatar
Jacob Thornton committed
24

Jacob Thornton's avatar
Jacob Thornton committed
25
    "use strict"
26

Jacob Thornton's avatar
Jacob Thornton committed
27
28
    /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
     * ======================================================= */
29

Jacob Thornton's avatar
Jacob Thornton committed
30
31
32
33
    $.support.transition = (function () {
      var thisBody = document.body || document.documentElement
        , thisStyle = thisBody.style
        , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
34

Jacob Thornton's avatar
Jacob Thornton committed
35
36
37
38
39
40
41
      return support && {
        end: (function () {
          var transitionEnd = "TransitionEnd"
          if ( $.browser.webkit ) {
          	transitionEnd = "webkitTransitionEnd"
          } else if ( $.browser.mozilla ) {
          	transitionEnd = "transitionend"
Jacob Thornton's avatar
Jacob Thornton committed
42
          } else if ( $.browser.msie ) {
43
            transitionEnd = "MSTransitionEnd"
Jacob Thornton's avatar
Jacob Thornton committed
44
45
46
47
48
49
50
51
52
          } else if ( $.browser.opera ) {
          	transitionEnd = "oTransitionEnd"
          }
          return transitionEnd
        }())
      }
    })()

  })
53
54

}( window.jQuery );