• Hi Elementor support team,
    I’m unable to slide to a specific slide. Can you please assist me?

    This is my code:

    jQuery(function($) {
    const swiper_target = $("#my-id .swiper-wrapper");
    const swiperInstance = swiper_target.data('swiper');
    console.log('Swiper Target:', swiper_target);
    console.log('Swiper Instance:', swiperInstance);
    
    if (swiper_target.length > 0 && swiperInstance) {
        swiperInstance.slideTo(5);
    } else {
        console.error('Swiper not found or not initialized.');
    }
    });

    This is the result on console.

    0: documentlength: 1Prototype: Object
    VM9691:6 Swiper Target: e. {0: div#swiper-wrapper-cb626e8a99ef12e4.swiper-wrapper, length: 1, prevObject: ce.fn.init}0: div#swiper-wrapper-cb626e8a99ef12e4.swiper-wrapperlength: 1prevObject: ce.fn.init {0: document, length: 1}Prototype: Object
    VM9691:7 Swiper Instance: undefined
    VM9691:13 Swiper not found or not initialized.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Swiper Instance is undefined.’ is closed to new replies.