WordPress.org

Ready to get started?Download WordPress

Forums

Slideshow
is there a way to tell the slideshow to skip to a certain slide? (3 posts)

  1. dagfooyo
    Member
    Posted 4 months ago #

    Hi - my client wants a slideshow with a thumbnail gallery next to it, where clicking on the thumbnails causes the slideshow to fade to that slide. I can take care of adding the thumbnail gallery, I just need to be able to get the slideshow to respond when the thumbnails are clicked.

    I know skipping from one slide to another is possible since you can do it using the nav buttons. However since the code is minified I can't figure out what function to call to replicate that behavior.

    Is there a way I can call a function that will tell a slideshow to skip to a certain slide? And if so how do I do that?

    Thanks for your help!

    https://wordpress.org/plugins/slideshow-jquery-image-gallery/

  2. Stefan Boonstra
    Member
    Plugin Author

    Posted 4 months ago #

    Hi,

    The latest version of the slideshow has an (undocumented) API, so you can use your own JavaScript to control the slideshow.

    You can find the uncompressed source code of the slideshow here.

    To animate to a specific slide, you'll need to ge the instance of the slideshow object. For this you'll also need to get the ".slideshow_container" jQuery element object of the slideshow.

    slideshowInstance = slideshow_jquery_image_gallery_script.getSlideshowInstance(jQuery('.slideshow_container'));

    With the "slideshowInstance" instance reference you can control the slideshow. It's a good idea to pause the slideshow before trying to animate to the next slide:

    slideshowInstance.pause();

    Next, you can call the "animateTo" method to show the slide corresponding to the passed integer index. The first slide has an index of 0.

    slideshowInstance.animateTo(0);

    You can then set the slideshow to play again:

    slideshowInstance.play();

    Best regards,
    Stefan

  3. dagfooyo
    Member
    Posted 4 months ago #

    Awesome! Thanks Stefan, that's exactly what I need :-)

Reply

You must log in to post.

About this Plugin

About this Topic