animate bar to percentage value using jquery
<p>I have a bar that I'm trying to animate and I'm missing something here. Here is my HTML</p>

<pre><code>&lt;div class="bar"&gt;&lt;span style="width: 74%;"&gt;&lt;/span&gt;&lt;/div&gt;
</code></pre>

<p>and here is the jquery:</p>

<pre><code>$(document).ready(function(){
$('.bar span').each(function(){
    var $percent = $(this).find('span').css('width') * 0.8;
    $(this).find('.bar span').animate(
        {width:$percent+"%"},
        {duration: 5000});
  })
});
</code></pre>

<p>I know I'm close...but can't seem to find the span to animate it.</p>

<p>Thank you all for your help. I wound up having it look for a number in the title tag as I couldn't get it to figure out the value of width. Here is the jquery I wound up with.</p>

<pre><code>$(document).ready(function(){
$('.bar span').each(function(){
var $percent = $(this).attr('title') * 0.8;
$(this).animate(
    {width:$percent+"%"},
    {duration: 1000});
  })
});
</code></pre>
