Giter Site home page Giter Site logo

Comments (7)

akalicki avatar akalicki commented on August 22, 2024

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.

tinybigideas avatar tinybigideas commented on August 22, 2024

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.

akalicki avatar akalicki commented on August 22, 2024

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.

tinybigideas avatar tinybigideas commented on August 22, 2024

Fantastic, sounds perfect! Thanks, and awesome work!

from jquery-simple-gallery.

akalicki avatar akalicki commented on August 22, 2024

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.

tinybigideas avatar tinybigideas commented on August 22, 2024

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.

akalicki avatar akalicki commented on August 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.