toggle effect in jquery not working
<p>Please, why is this not working:</p>

<pre><code>$("#togglePanel").click(function(e){        
    $("#toolpanel").toggle(function(){
        $("#orderMap").animate({marginLeft: 0, width: "100%"}, 500);
    }, function(){
        $("#orderMap").animate({marginLeft: "341px", width: "576px"}, 500);
    });
});
</code></pre>

<p>But when I do this, it works:</p>

<pre><code>$("#togglePanel").click(function(e){        
    $("#toolpanel").toggle(function(){
        $("#orderMap").animate({marginLeft: 0, width: "100%"}, 500);
    });
});
</code></pre>

<p>Thanks...</p>
