This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var element = document.getElementById('transition'); //get the element you want the timing-function of | |
var style = element.currentStyle || window.getComputedStyle(element, null); //get the styles for that element | |
var timingFunction = style.transitionTimingFunction; //specifically select the transitionTimingFunction from the styles | |
function convertTimingFunctionToCubicBezier(timingFunction) { | |
var timingFunctionToCubicBezier = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* sample cubic beziers */ | |
linear = [0.250, 0.250, 0.750, 0.750]; | |
ease = [0.250, 0.100, 0.250, 1.000]; | |
easeIn = [0.420, 0.000, 1.000, 1.000]; | |
easeOut = [0.000, 0.000, 0.580, 1.000]; | |
easeInOut = [0.420, 0.000, 0.580, 1.000]; | |
function reverseCubicBezier(cubicBezier) { | |
return [ | |
1 - cubicBezier[2], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(imagesToPreload).each(function(){ | |
var imgSrc = $(this).attr("src"); //get the image src so it can be put back in to convince IE to run the .load() function correctly | |
$(this).load(function(){ | |
//do something as the images are loaded (eg, count them to make sure they're all loaded then run a callback) | |
}).attr("src", imgSrc); //makes .load() work in IE when images are cached | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="transform origin"> | |
Element to be transformed | |
</div> | |
|