jquery show div when :last is shown
<p>As the title says I'm trying to get a div to show when <code>:last</code> is shown, here is what I have so far</p>

<pre><code>$(function() {
    $('#d').hide();
    var $images = $('#d1 &gt; .c1 &gt; a').clone(),
        $imgShow = 0;
    $('#d1 &gt; .c1').html($('#d1 &gt; .c1 &gt; a:first'));
    $('#d1 &gt; .c1 &gt; a').click(function(e) {
        var $n = $('img', $images).eq(++$imgShow).attr('src');
        $(this).children().attr('src', $n);
        e.preventDefault();
    });
});
</code></pre>

<p>​</p>

<p><a href="http://jsfiddle.net/EjGnK/3/" rel="nofollow">see jfiddle for demo</a></p>

<p>I tried with on <code>:last</code> click but that didn't seem to work (hence it being commented out in jfiddle) plus having it be shown when <code>:last</code> is in view is a better option anyway, how can this be achieved?</p>
