Skip to content

Instantly share code, notes, and snippets.

@joseanpg
Created April 28, 2011 20:24
Show Gist options
  • Select an option

  • Save joseanpg/947255 to your computer and use it in GitHub Desktop.

Select an option

Save joseanpg/947255 to your computer and use it in GitHub Desktop.
humane.js unnecessary let
/**********************************************************************
Current Version: unnecessary scope
**********************************************************************/
eventOn('load',function(){
transitionSupported = (function(style){ //Surplus
var prefixes = ['MozT','WebkitT','OT','msT','KhtmlT','t'];
for(var i = 0, prefix; prefix = prefixes[i]; i++){
if(prefix+'ransition' in style) return true;
}
return false;
}(doc.body.style));
humane.setup();
});
/**********************************************************************
Fixed
**********************************************************************/
eventOn('load',function(){
/*transitionSupported = false; //Optional */
var prefixes = ['MozT','WebkitT','OT','msT','KhtmlT','t'];
var style = doc.body.style;
for(var i = 0, prefix; prefix = prefixes[i]; i++){
if(prefix+'ransition' in style) {
transitionSupported = true;
break;
}
}
humane.setup();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment