Better way to implement a shake animation?
<p>I am trying to implement a "shake animation" using jQuery.  The idea is that you can make an element shake to draw attention to it.  Below is what I came up with:</p>

<pre><code>    function DrawAttention(item, count)
    {
        $(item).animate({top: '+=5'}, 50,
            function(){
                $(item).animate({top: '-=10'}, 100,
                    function(){
                       $(item).animate({top: '+=5'}, 50,
                            function(){
                                if(count&gt;0)
                                {
                                    DrawAttention(item,count-1);
                                }
                            }); 
                    });
            });

    }
</code></pre>

<p>I thought this was a little verbose and was wondering if anyone can see a more elegant way to achieve what I want.</p>

<p>Fiddle <a href="http://jsfiddle.net/uaWkj/" rel="nofollow">here</a>.</p>
