I'm currently creating a project where we need out users to be able to browser thru different media types. Currently Images, Video and "360- images". Since we are really concearned about the highest availability we decided to create the 360-viewer with JavaScript, in the form of a jQuery plugin.
The plugin, after some tweaking, turned out to work perfect. However, I have trouble releasing the window.setInterval when the div that has been applied the image rotator is removed from the DOM. Here's the plugin in it's full: http://www.pastie.org/306425 Here's the code calling the plugin: http://pastie.org/306434 Please notice that the paste contains two plugins acutally. The uppermost is used to disable browser selecting. At line 56 I'd like to add some code that makes sure the element is still in the DOM. I've tried approaching this with $(element).is('*'), $(element).lenght, but both reports that the element exists even though it has been removed. If I test with $(element).hasClass it can be accomplished at runtime in Firebug, but whenever I add any attributes in the plugin-scope it doesnt seem to apply to the DOM itself. This is my first Plug-in for JQuery, so please feel free to give any feedback, including improvements om best practice. Best regards, Pontus