Example : I run the function addimagezoom() on click like this.
$("#section").click(function() {
$('#img1').addimagezoom();
});
$("#stop").click(function() {
//How I can stop the addimagezoom function here by clicking on this button
});
I think it’s probably more complicated than this because it really depends on what you’re doing in the imagezoom function. For example, I assume it’s a function that’s being fired continuously which is why you need to its code to stop executing? If so there’s likely an interval involved that just needs to be cleared instead (the Boolean method would still technically work but clearing the interval would be much more efficient).