title: Javascript variables - setting as percentage
body: <pre><code>&lt;div class="contentBlockOne"&gt;
          &lt;span class="moreButton"&gt;More&lt;/span&gt;
          &lt;br /&gt;Each block will have an article summary in it.&lt;/div&gt;
  </code></pre>
  
  <p>I want to increase the width of "Div" on a "Span" click with the following jQuery ( I havn't bothered including the else part):</p>
  
  <pre><code>            var currentWidth = $('.moreButton').parent().width();               
              $('.moreButton').click(function () {
                  if ($(this).parent().width == currentWidth) {
                      $(this).parent().animate({ width: '98%' }, 800);                        
                      $(this).text('Less');
                  }
  </code></pre>
  
  <p>In my head the "currentWidth" variaeble should be the same as the parents width. But when debugging, the code does not do anything. I presume it is because the, for what ever reason, the two width values are not the same. </p>