-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to detach/destroy gallery for recreation #6
Comments
Thanks for the feedback! I'll definitely look into adding something that makes what you're trying to do a bit easier. Do you have your implementation hosted anywhere I can take a look? |
Hey - thanks, here's how I'm currently doing it: if ($('.gallery #gallery-image').length) {
$('.gallery #gallery-image').remove();
$('.gallery-thumbnails li img').removeClass('selected');
$('.gallery .gallery-image-holder').append('<div id="gallery-image"></div>');
$('.gallery #gallery-image').gallery({
source: '[id=' + tabId.split('#')[1] + '] .gallery-thumbnails li img'
});
} I remove, and essentially recreate on a new source every time the tab is changed. But I'd love a simple: $('.gallery #gallery-image').gallery('destroy'); or a simple way to dynamically change the source: $('.gallery #gallery-image').gallery('changeSource', source); |
Thanks for the details. I think both of those should be fairly easy to do and I'll try to get to them soon. What functionality should the destroy function have? I'm thinking it would just finish the fade out, remove the |
Fantastic, sounds perfect! Thanks, and awesome work! |
v2.5.0 is up and should address some of these requests:
You can change the gallery's source using the typical option change method: $('gallery #gallery-image').gallery('option', 'source', newSource); and you can destroy the gallery using the public destroy method: $('gallery #gallery-image').gallery('destroy'); Let me know if this solves your problem! I'll keep the issue open until you verify that it's working as hoped. |
Unfortunately, I've shipped the project I was working on with my work around, so I'm not able to easily test any more. But I'm sure it'll all be great! Next time I'm looking for a gallery, I'm 100% using this again as it was exactly what I needed. Awesome job! |
Great, thanks for the feedback - these features should've been included in the initial release so I'm glad you brought them up now. I originally wrote the plugin just for personal use so I'm glad to see that others are finding it helpful as well! Cheers, |
First off, great little plugin! I'm using inside a tab system, so I'd love an easy way to destroy and recreate the plugin on demand to rebind a dynamic source when required.
At the moment, it's a little fiddly - although, any help much appreciated!
The text was updated successfully, but these errors were encountered: