After I've called a jquery method that is part of a plugin, I want to terminate what it is doing. The plugin has an internal function that continously gets called with setTimeout. When my html content no longer needs this plugin, I want to stop the plugin otherwise its internal function goes on indefinitely. I thought that maybe I can either remove the plugin from the element that it is attached to or call clearInterval on the internal timer but I'm not sure how to access that from the object the plugin is attached to.
Asked
Active
Viewed 52 times
-1
-
2we need to see the plugin – Arun P Johny Aug 21 '13 at 11:15
-
1Does the plugin not have some sort of documentation? – nnnnnn Aug 21 '13 at 11:17
-
Found a duplicate here: http://stackoverflow.com/a/8302569/753632 – Johann Aug 21 '13 at 11:18
1 Answers
0

Community
- 1
- 1

Wellington Zanelli
- 1,894
- 3
- 18
- 43
-
I think the OP knows that (though the question mentions `clearInterval()` rather than `clearTimeout()`). Isn't the main point that he or she doesn't know how to access the internals of the plugin to get the timer id to pass to `clearTimeout()`? – nnnnnn Aug 21 '13 at 11:32
-
He must use the `clearTimeout()` instead of `clearInterval()`. That's the only answer that I can do without more info about the plugin. – Wellington Zanelli Aug 21 '13 at 11:38