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