How to create a custom function which i can turn it off on a click?
<p>I am running a bit of code once the page load so in the footer i have got:</p>

<pre><code>$(function(){
  //code to run on page load
});
</code></pre>

<p>But then i need to stop that code to run on a</p>

<pre><code>.click() 
</code></pre>

<p>I was thinking of having a custom function which runs on page load and then be able to disabale that function on a click.</p>

<p>How to create a custom function which i can turn it off on a click?</p>
