title: Kill function after click event JavaScript
body: <p>I have a function that I want to be stopped when I run a 'close' click event. </p>
  
  <p>The reasoning behind this is when I run <code>img.start</code> click event for the second time, the function is called again and is now running twice.</p>
  
  <p>The function in question is a slideshow, so I really do need the function to only ever be running once on a page.</p>
  
  <p>So just to be clear, when I click on <code>img.close</code>, I want the <code>BannerSlideshow</code> function to stop and not be running anymore.</p>
  
  <p><strong>Start function click event</strong></p>
  
  <pre><code>$('img.start').click(function () {
    BannerSlideshow.Init()
  });
  </code></pre>
  
  <p><strong>End function click event</strong></p>
  
  <pre><code>$('img.close').click(function () {
    //stop function BannerSlideshow from running
  });
  </code></pre>
  
  <p><strong>Snippet of slideshow function</strong></p>
  
  <pre><code>var BannerSlideshow = (function () {
  return {
      Init: function () {
          //slideshow functionality            
      }
  </code></pre>
  
  <p><em>I have updated my question to be more specific, apologies guys.</em></p>