Sticky-Anything
Sticky-Anything copied to clipboard
retain timeoutId from setInterval() in object, provide unstick() function
Store the timeoutId from setInterval() inside the object so it can be used for clearTimeout(). As it is right now if the element being watched is removed from the DOM then errors start piling up quickly.