Skip to content

Instantly share code, notes, and snippets.

@tonetheman
Created May 13, 2012 04:56
Show Gist options
  • Save tonetheman/2681464 to your computer and use it in GitHub Desktop.
Save tonetheman/2681464 to your computer and use it in GitHub Desktop.
javascript to rotate image on html page
// see this page
// http://www.kavoir.com/2009/08/css-rotate-text-image-elements-by-90-180-or-270-degrees.html
// here is the javascript
// 1. get the element
// 2. get the style
// 3. get the webkitTransform and assign it a value of the rotation degree you want
document.getElementsByTagName("img")[0]
.style.webkitTransform = "rotate(-90deg)";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment