jquery: assigning div to object variable for caching
<p>I have the following code that works inside a function:</p>

<pre><code>$('#MyPanel').stop().animate({ top: PanelTop }, 300);
</code></pre>

<p>However, I'd like to assign the div to an object so that jquery doesn't have to reevaluate the reference every time.</p>

<p>I have a global variable and then I want to work with it in my function like this:</p>

<pre><code>var ThePanel = $('#MyPanel');

ThePanel.stop().animate({ top: PanelTop }, 300);
</code></pre>

<p>Nothing happens. Any idea why?</p>

<p>Thanks.</p>
