[cycle] How to "unbind" a jQuery Cycle slideshow?
I am once again trying to twist and squeeze Mike's wonderful Cycle plugin into uses it wasn't originally intended for:
What I'm trying to accomplish:
I have a page, with a few thumbnails, each representing a gallery. When you click on the gallery thumbnail, a slideshow gets loaded into another area of the page. I haven't had any problem emptying the slideshow container and adding in new images, but I'm not sure of the right way (or if there even is a right way) to place the calls to .cycle()
What works
//Just call .cycle() every time:
targetGallery.html( newGallery.html() );
targetGallery.cycle();
This works really well -- in fact it works almost perfectly. The only part that doesn't work (the way I want) is that containerResize only triggers the first time I call .cycle(). After that, of course, the container has a size, and so subsequent calls to .cycle() don't do a containerResize.
Maybe I just need to unset the 'height' of the container right before I call .cycle() the second time... Yeah, I think I just answered my own question there.
What I originally intended to ask
Is there any way to "destroy" or "unbind" a cycle slideshow, thereby undoing the changes that .cycle() makes to the DOM?
What I'll ask Instead
Is there a better way to do what I describe above? Cycle is very good about only keeping one Timeout going for each container, so that's not a problem, but I do feel like I'm abusing the plugin.