Permalink
Browse files

Merge pull request #2 from AntonTrollback/master

Used this (great) plugin today and noticed lack of IE prefixes
  • Loading branch information...
snookca committed Feb 13, 2012
2 parents 18c7c1e + 613b1df commit db7bbc37ef1f3c10564b81df9b714cd07d90375d
Showing with 17 additions and 16 deletions.
  1. +10 −9 example.html
  2. +6 −6 preparetransition.js
  3. +1 −1 preparetransition.min.js
View
@@ -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
@@ -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

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit db7bbc3

Please sign in to comment.