Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added prefix for IE10, removed trailing slashes

  • Loading branch information...
commit 613b1dfd1cd3ff2d705f9935f17f6f39a5a69ccf 1 parent 18c7c1e
@AntonTrollback AntonTrollback authored
Showing with 17 additions and 16 deletions.
  1. +10 −9 example.html
  2. +6 −6 preparetransition.js
  3. +1 −1  preparetransition.min.js
View
19 example.html
@@ -8,14 +8,15 @@
<style>
- .msg {
+ .msg {
position: absolute;
- padding: 5px 10px;
- border-radius: 10px;
- background-color: #CCC;
- -webkit-transition: opacity 1s;
- -moz-transition: opacity 1s;
- -o-transition: opacity 1s;
+ padding: 5px 10px;
+ border-radius: 10px;
+ background-color: #CCC;
+ -webkit-transition: opacity 1s;
+ -moz-transition: opacity 1s;
+ -ms-transition: opacity 1s;
+ -o-transition: opacity 1s;
opacity: 1;
}
@@ -29,9 +30,9 @@
.is-transitioning {
display: block !important;
- visibility: visible !important;
+ visibility: visible !important;
}
-
+
</style>
</head>
View
12 preparetransition.js
@@ -1,6 +1,6 @@
/**
* prepareTransition
- * jQuery Plugin for ensuring transitions with display:none or visibility:hidden
+ * jQuery Plugin for ensuring transitions with display:none or visibility:hidden
* are in the right state until the end of the transition
*
* Developed by Jonathan Snook (http://snook.ca/)
@@ -12,7 +12,7 @@
* visibility: visible !important;
* }
*
- * MIT license
+ * MIT license
* http://www.opensource.org/licenses/mit-license.php
*/
@@ -22,12 +22,12 @@ $.fn.prepareTransition = function(){
return this.each(function(){
var el = $(this);
// remove the transition class upon completion
- el.one('TransitionEnd webkitTransitionEnd transitionend oTransitionEnd', function(){
+ el.one('TransitionEnd webkitTransitionEnd transitionend oTransitionEnd MSTransitionEnd', function(){
el.removeClass('is-transitioning');
});
// check the various CSS properties to see if a duration has been set
- var cl = ["transition-duration", "-moz-transition-duration", "-webkit-transition-duration", "-o-transition-duration"];
+ var cl = ["transition-duration", "-moz-transition-duration", "-webkit-transition-duration", "-o-transition-duration", "-ms-transition-duration"];
var duration = 0;
$.each(cl, function(idx, itm){
duration = parseFloat( el.css( itm ) ) || duration;
@@ -36,10 +36,10 @@ $.fn.prepareTransition = function(){
// if I have a duration then add the class
if (duration != 0) {
el.addClass('is-transitioning');
- el[0].offsetWidth; // check offsetWidth to force the style rendering
+ el[0].offsetWidth; // check offsetWidth to force the style rendering
};
});
-}
+};
}(jQuery));
View
2  preparetransition.min.js
@@ -1,2 +1,2 @@
/* Jonathan Snook - MIT License - https://github.com/snookca/prepareTransition */
-(function(a){a.fn.prepareTransition=function(){return this.each(function(){var b=a(this);b.one("TransitionEnd webkitTransitionEnd transitionend oTransitionEnd",function(){b.removeClass("is-transitioning")});var c=["transition-duration","-moz-transition-duration","-webkit-transition-duration","-o-transition-duration"];var d=0;a.each(c,function(a,c){d=parseFloat(b.css(c))||d});if(d!=0){b.addClass("is-transitioning");b[0].offsetWidth}})}})(jQuery)
+(function(a){a.fn.prepareTransition=function(){return this.each(function(){var b=a(this);b.one("TransitionEnd webkitTransitionEnd transitionend oTransitionEnd MSTransitionEnd",function(){b.removeClass("is-transitioning")});var c=["transition-duration","-moz-transition-duration","-webkit-transition-duration","-o-transition-duration","-ms-transition-duration"];var d=0;a.each(c,function(a,c){d=parseFloat(b.css(c))||d});if(d!=0){b.addClass("is-transitioning");b[0].offsetWidth}})}})(jQuery)
Please sign in to comment.
Something went wrong with that request. Please try again.