• Resolved Dennis Heiden

    (@dennisheiden)


    Hi,

    the 5.x brings a new slider (Swiper) lib to Gutenslider.
    Somehow I don’t get how I can interact with the new lib to programmatically slide to the next slide.

    With Slick you could do something like this:
    jQuery(‘.wp-block-eedee-block-gutenslider .slick-slider’).slick(‘slickGoTo’, slideNum);

    For Swiper it should be:
    swiper.slideTo(index, speed, runCallbacks)

    But the swiper object / lib is not available and I was unable to get the right const from your source files.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author eedee

    (@eedee)

    @dennisheiden the swiper object is attached to the .wp-block-eedee-block-gutenslider dom elements and is saved in the swiperInstance attribute. Also thus is mit Tester Set you should be able to change it that way and call methods.

    Please contact us if you need more support.

    Thread Starter Dennis Heiden

    (@dennisheiden)

    Thanks, I was able to access the swiper with your information.

    For everyone else, you can do something like this:

    jQuery('.wp-block-eedee-block-gutenslider')[0].swiperInstance.slideTo(slideNum);
    // this only selects the first slider on the page, you might want to change the selection process for multislider support

    // if you want to use the slider in a modal or something like that, you need to call update() before doing slideTo

    jQuery('.wp-block-eedee-block-gutenslider')[0].swiperInstance.update();

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Swiper – SlideTo’ is closed to new replies.