bootstrap-transition.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* ===================================================
  2. * bootstrap-transition.js v2.0.4
  3. * http://twitter.github.com/bootstrap/javascript.html#transitions
  4. * ===================================================
  5. * Copyright 2012 Twitter, Inc.
  6. *
  7. * Licensed under the Apache License, Version 2.0 (the "License");
  8. * you may not use this file except in compliance with the License.
  9. * You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS,
  15. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. * See the License for the specific language governing permissions and
  17. * limitations under the License.
  18. * ========================================================== */
  19. !function ($) {
  20. $(function () {
  21. "use strict"; // jshint ;_;
  22. /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
  23. * ======================================================= */
  24. $.support.transition = (function () {
  25. var transitionEnd = (function () {
  26. var el = document.createElement('bootstrap')
  27. , transEndEventNames = {
  28. 'WebkitTransition' : 'webkitTransitionEnd'
  29. , 'MozTransition' : 'transitionend'
  30. , 'OTransition' : 'oTransitionEnd'
  31. , 'msTransition' : 'MSTransitionEnd'
  32. , 'transition' : 'transitionend'
  33. }
  34. , name
  35. for (name in transEndEventNames){
  36. if (el.style[name] !== undefined) {
  37. return transEndEventNames[name]
  38. }
  39. }
  40. }())
  41. return transitionEnd && {
  42. end: transitionEnd
  43. }
  44. })()
  45. })
  46. }(window.jQuery);