Glide: Autoplay not working

Created on 20 Mar 2019  路  2Comments  路  Source: glidejs/glide

Hi, autoplay isn't working in my setup for this site. You can check https://pillr.org/

// Initialize Carousel
if (document.querySelector('.glide')) {
    new Glide('.glide').mount({
        autoplay: true
    });
}

Could you check and advise? Thanks.

Most helpful comment

Hey @k16e, you are passing the options to the wrong method.

As described in the docs, Glide accepts the options as a second parameter of the Glide class itself. In your case the correct code would be:

// Initialize Carousel
if (document.querySelector('.glide')) {
    new Glide('.glide', {
        autoplay: true
    }).mount();
}

Cheers

All 2 comments

Hey @k16e, you are passing the options to the wrong method.

As described in the docs, Glide accepts the options as a second parameter of the Glide class itself. In your case the correct code would be:

// Initialize Carousel
if (document.querySelector('.glide')) {
    new Glide('.glide', {
        autoplay: true
    }).mount();
}

Cheers

Done. I'm glad I asked, I was doing it wrong. Thanks very much!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Danielvandervelden picture Danielvandervelden  路  4Comments

thasmo picture thasmo  路  4Comments

robertu7 picture robertu7  路  6Comments

philmarc picture philmarc  路  3Comments

iaarab picture iaarab  路  4Comments