Skip to content

Instantly share code, notes, and snippets.

@jrmoran
Created November 4, 2011 00:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrmoran/1338317 to your computer and use it in GitHub Desktop.
Save jrmoran/1338317 to your computer and use it in GitHub Desktop.
Roll
(function(){
var styleObj=document.createElement("style");
styleObj.setAttribute("type","text/css");
document.getElementsByTagName("head")[0].appendChild(styleObj);
var style = "@-webkit-keyframes roll { from { -webkit-transform: rotate(0deg) } to { -webkit-transform: rotate(360deg) } } @-moz-keyframes roll { from { -moz-transform: rotate(0deg) } to { -moz-transform: rotate(360deg) } } @keyframes roll { from { transform: rotate(0deg) } to { transform: rotate(360deg) } } body { -moz-animation-name: roll; -moz-animation-duration: 4s; -moz-animation-iteration-count: 1; -webkit-animation-name: roll; -webkit-animation-duration: 4s; -webkit-animation-iteration-count: 1; }";
styleObj.appendChild(document.createTextNode(style));
}());
javascript:(function(){var a=document.createElement("style");a.setAttribute("type","text/css");document.getElementsByTagName("head")[0].appendChild(a);var b="@-webkit-keyframes roll { from { -webkit-transform: rotate(0deg) } to { -webkit-transform: rotate(360deg) } } @-moz-keyframes roll { from { -moz-transform: rotate(0deg) } to { -moz-transform: rotate(360deg) } } @keyframes roll { from { transform: rotate(0deg) } to { transform: rotate(360deg) } } body { -moz-animation-name: roll; -moz-animation-duration: 4s; -moz-animation-iteration-count: 1; -webkit-animation-name: roll; -webkit-animation-duration: 4s; -webkit-animation-iteration-count: 1; }";a.appendChild(document.createTextNode(b))})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment