fredleblanc / roundabout

A 3D Turntable jQuery Plugin.
645 stars 203 forks source link

Add "destroy" method #73

Open mattstauffer opened 12 years ago

mattstauffer commented 12 years ago

Per conversations here: https://github.com/fredhq/roundabout/issues/56#issuecomment-9463306 , I added a "destroy" method that un-binds the Roundabout code and returns the element to its original state.

retlehs commented 11 years ago

thanks @mattstauffer - this worked perfect for a responsive site i'm working on when needing to re-init at a certain screen size

matthewhall commented 11 years ago

This throws errors if autoplay and responsive are enabled due to the stopAutoplay and relayoutChildren methods trying to access non-existant .data("roundabout").

mattstauffer commented 11 years ago

Hey Matt, That's great! Could you do a pull request and I'll bring it into this fork?

Thanks, -matt

On Tue, Apr 16, 2013 at 4:37 AM, Matt Hall notifications@github.com wrote:

This seems to throw a JS error when autoplay is enabled. I fixed by adding this to your destroy method:

// Clear autoplay timersclearTimeout(data.autoplayStartTimeout);clearInterval(data.autoplayInterval);

Just after:

// Unbind window listeners$(window).unbind(".roundabout");

Thanks.

— Reply to this email directly or view it on GitHubhttps://github.com/fredhq/roundabout/pull/73#issuecomment-16435263 .

matthewhall commented 11 years ago

Sure. I adjusted my original comment as the "fix" I'd provided didn't quite work.

I think I've fixed it properly now. Will provide a pull request once I've properly tested it.

Thanks.