title: Changing player's turn
body: <p>i need help in changing the player's turn.</p>
  
  <pre><code>    var player = 'RED';
  
      $(function() {
  
      $(whosturn(player)).draggable({
          revert: true,
          stop: {
              player = 'BLUE';
      }
      });
      });
  
  
      function whosturn(player) {
          if(player == 'RED') {
              return '.red';
          } else if(player == 'BLUE') {
              return '.blue';
          }
      }
  </code></pre>
  
  <p>Heres the <a href="http://jsfiddle.net/euTwT/" rel="nofollow">link</a> to jsFiddle.</p>
  
  <p>when the draggable stop, the player change its value to BLUE, so when i drag the 'Drag me blue' it wont be drag. i think the program only use the first value of the variable.
  sorry for some wrong grammar. thanks in advance.</p>