Swiper: Swiper not working until I resize browser window

Created on 21 Dec 2018  路  6Comments  路  Source: nolimits4web/swiper

i using wrap-swiper. it incorrect working util i resize brower size. Has anyone else had this problem?. Please help me. thank

stale

Most helpful comment

Temporary fix might be:

mySwiper = new Swiper('.swiper-container', {
    // ...
})
setTimeout(() => {
    mySwiper.update()
}, 500)

All 6 comments

Temporary fix might be:

mySwiper = new Swiper('.swiper-container', {
    // ...
})
setTimeout(() => {
    mySwiper.update()
}, 500)

@cagcak Life saver.

Spent half an hour counting the number of hairs I pulled out while trying to work around this issue.

Thanks @cagcak.

When you initialize swiper can be important, before or after CSS has been rendered.

https://github.com/nolimits4web/swiper/issues/2218#issuecomment-509683102

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue has been automatically closed due to inactivity. If this issue is still actual, please, create the new one.

Was this page helpful?
0 / 5 - 0 ratings