Js animated width w/o jquery
<p>Like i said in title, im trying to animate a element width with js:</p>

<pre><code>function floatMenu(rewidth){
if(rewidth.className == ''){ 
   rewidth.className = 'open'; x = rewidth.style.width;
   x = x.slice(0, -2);
   while(x &lt; 190){
      x++; rewidth.style.width = x;
   }
} else {
   rewidth.className = '';x = rewidth.style.width;
   x = x.slice(0, -2);
   while(x &gt; 30){
      x--;  rewidth.style.width = x;
   }
};
</code></pre>

<p>}
</p>

<p><strong>tried setTimeout already.</strong></p>

<p>Ty for the answers</p>

<p>it ends up with the last value, not incrementing step by step.</p>
