Comments (7)
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?
from jquery-simple-gallery.
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);
from jquery-simple-gallery.
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 selected
class, and stop the images from cycling. Does that sound good?
from jquery-simple-gallery.
Fantastic, sounds perfect! Thanks, and awesome work!
from jquery-simple-gallery.
v2.5.0 is up and should address some of these requests:
- adds the ability to change the source while the gallery's going
- adds the ability to destroy the gallery
- new events are triggered when options are changed or the gallery is destroyed
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.
from jquery-simple-gallery.
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!
from jquery-simple-gallery.
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,
Alex
from jquery-simple-gallery.
Related Issues (8)
- Add photo description functionality
- Captions switch even when stopAnimation is called
- Separate _create() and _init() methods
- Fire custom events when gallery's status changes HOT 1
- Link to sites that currently use plugin
- Conflict with multiple galleries and other document elements using class selected HOT 1
- Displaying different sized images HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-simple-gallery.