How do I get a element to appear/disappear once HTML document height is adjusted, in JQuery?
<p>See code below</p>

<p>Objective: If the browser window has a vertical scroll, show #scroll-top...else hide #scroll-top. </p>

<p>Problem: I have elements on my page that I can toggle therefore adjusting the page height, hence affecting if the browser scrollbar is visible or not.</p>

<p>Question: How do I get #scroll-top to disappear if I collapse/toggle all elements on the page &amp; appear once I expand all elements?</p>

<pre><code>var hContent = $("body").height(); 
var hWindow = $(window).height(); 

if(hContent&gt;hWindow) {
    $('#scroll-top').fadeIn(250);    
}
else {
    $('#scroll-top').fadeOut(250);
}
</code></pre>

<p>Any help is Greatly Appreciated, Thanks</p>
