title: Rotating a CSS3 3d cube with javascript
body: <p>I am trying  to rotate a 3d cube with two controls - for left and right. When you click on the left button, for example, I'd like to add extra 40 degrees to the rotateY value on the left. </p>
  
  <p>My question is: Since I can't work with exact values (I want everytime to add new values to the existing ones!), I guess I will have to split up the string for the transform into something like this:</p>
  
  <pre><code>$(cube).css("-webkit-transform", "rotateX(-100deg) rotateZ(-50deg + add 40 degrees to the existing one!) translateZ(-30px)");
  </code></pre>
  
  <p>Here is the pen I am working on:</p>
  
  <p><a href="http://codepen.io/gbnikolov/pen/hHEBG" rel="nofollow">http://codepen.io/gbnikolov/pen/hHEBG</a></p>