title: How can I rotate this cube properly with Javascript or Jquery?
body: <p>Made a 3d cube. When a button is clicked, it rotates 50 deg left or right. I want it rotate an additional 50deg further when I click the same button. How do I achieve this? Here is my code right now: </p>
  
  <pre><code>//code to rotate cube
  var rotateCube = document.getElementById('cube');
  
  var moveLeft = document.getElementById('button-one');
  var moveRight = document.getElementById('button-two');
  
  
  
  moveLeft.onclick = function() {
      rotateCube.style.webkitTransform = "rotateY(-50deg)";
  }
  moveRight.onclick = function() {
      rotateCube.style.webkitTransform = "rotateY(50deg)";
  }
  </code></pre>
  
  <p>in full here:
  <a href="http://jsfiddle.net/camlatimer/6xp2dwe7/1/" rel="nofollow">http://jsfiddle.net/camlatimer/6xp2dwe7/1/</a></p>
  
  <p>I've searched around. There are examples like this one:
  <a href="http://paulrhayes.com/experiments/cube-3d/" rel="nofollow">http://paulrhayes.com/experiments/cube-3d/</a></p>
  
  <p>But I'm new to programming (2 months of fiddling with javascript in my free time) and don't understand much.  I thought I could complete my objective pretty easily, but I'm stuck. I don't want to use any plugins. Just want to learn to really program things on my own. Any help would be appreciated. </p>