Created
June 15, 2010 16:52
-
-
Save gavinblair/439360 to your computer and use it in GitHub Desktop.
Functions to make plain old Javascript easier to use, without a framework
This file contains hidden or 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
//How can we make this one work with classes and tags? | |
function $(id){ | |
return document.getElementById(id); | |
} | |
function html(id, html){ $(id).innerHTML = html; } | |
function css(id, style){ $(id).style.cssText += ';'+style; } | |
//iPhone/iPad/iPod browser animations | |
function anim(id, transform, opacity, dur){ | |
css(id, '-webkit-transition:-webkit-transform'+ | |
',opacity '+(dur||0.5)+'s,'+(dur||0.5)+'s;-webkit-transform:'+ | |
transform+';opacity:'+(1||opacity)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
via http://mir.aculo.us/2010/06/04/making-an-ipad-html5-app-making-it-really-fast/