jQuery event to trigger action when a div is made visible
<p>I'm using jQuery in my site and I would like to trigger certain actions when a certain div is made visible.</p>

<p>Is it possible to attach some sort of "isvisible" event handler to arbitrary divs and have certain code run when they the div is made visible?</p>

<p>I would like something like the following pseudocode:</p>

<pre><code>$(function() {
  $('#contentDiv').isvisible(function() {
    alert("do something");
  });
});
</code></pre>

<p>The alert("do something") code should not fire until the contentDiv is actually made visible.</p>

<p>Thanks.</p>
