Difference between revisions of "Webkit transform"

From WebOS Internals
Jump to navigation Jump to search
Line 3: Line 3:
 
I'm putting this together to illustrate how to use webkit to transform any IDed content and transform it in various ways.  My first example will be rotating an image with a static setting and using a variable.  (do not delete, this is a placeholder and it will have useful content added tonight 7/20.)
 
I'm putting this together to illustrate how to use webkit to transform any IDed content and transform it in various ways.  My first example will be rotating an image with a static setting and using a variable.  (do not delete, this is a placeholder and it will have useful content added tonight 7/20.)
  
dynamic rotation:
+
dynamic rotation:<br>
document.getElementById('elementId').style.WebkitTransform = 'rotate('+ variableName + 'deg)';
+
document.getElementById('elementId').style.WebkitTransform = 'rotate('+ variableName + 'deg)';<br>
 
+
<br>
static rotation
+
static rotation:<br>
document.getElementById('elementId').style.WebkitTransform = 'rotate(45deg)';
+
document.getElementById('elementId').style.WebkitTransform = 'rotate(45deg)';<br>

Revision as of 05:11, 21 July 2009

Work in progress...

I'm putting this together to illustrate how to use webkit to transform any IDed content and transform it in various ways. My first example will be rotating an image with a static setting and using a variable. (do not delete, this is a placeholder and it will have useful content added tonight 7/20.)

dynamic rotation:
document.getElementById('elementId').style.WebkitTransform = 'rotate('+ variableName + 'deg)';

static rotation:
document.getElementById('elementId').style.WebkitTransform = 'rotate(45deg)';