end javascript function after process?
<p>can someone please let me know if there is a way that I can get this piece of JavaScript to stop or time out after it's completed it's process?</p>

<p>Currently I have a jQuery lightbox pop up window that launches when users click on images. However I was having problems getting the jQuery lightbox to close and so added a JavaScript to close it when a user clicks a certain <code>div</code>. </p>

<p>Now this all works fine but once the jQuery lightbox is closed a user cant open up another photo because the lightbox wont open.</p>

<p>Is there away around this?</p>

<p>Thanks.</p>

<pre><code>&lt;script&gt;
    $('#sb-nav a').click(function(e) { //button click class name is myDiv 
        e.stopPropagation(); 
    }) 
    $(function(){ 
        $('#sb-nav a').click(function(){   
            $('#sb-container').hide(); //hide the button 
            $('#sb-nav a').hide(); //hide the button 
        }); 
    }); 
&lt;/script&gt; 
</code></pre>
