View gist:5468127
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 = {
View gist:4666512
/* 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],
View gist:3679971
$(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
});
View index.html
<div class="transform origin">
Element to be transformed
</div>