I am running a bit of code once the page load so in the footer i have got:
$(function(){
//code to run on page load
});
But then i need to stop that code to run on a
.click()
I was thinking of having a custom function which runs on page load and then be able to disabale that function on a click.
How to create a custom function which i can turn it off on a click?
A simple way would be to add a flag/preference variable to your page, which dictates which logic can be executed and when.
Whenever code is then executed, just check the preference, i.e.