nolimits4web / swiper

Most modern mobile touch slider with hardware accelerated transitions
https://swiperjs.com
MIT License
39.93k stars 9.74k forks source link

Swiper not working properly on only Mozilla Browser #3510

Closed Rwarlock closed 3 years ago

Rwarlock commented 4 years ago

This is a (multiple allowed):

What you did

EXPLAIN WHAT YOU DID, PREFERABLY WITH CODE EXAMPLES, HERE. I added a swiper slider only on the mobile using the following JS

$( document ).ready(function() {

var mySwiper2 = undefined;
        function initSwiper() {
            var screenWidth = $(window).width();
            if (screenWidth < 764 && mySwiper2 == undefined) {
                mySwiper2 = new Swiper('.swiper-container', {
                    loop: true,
                    centeredSlides: true,
                    slidesPerView: 'auto',
                    spaceBetween: 30,
                    speed: 200,

                })
            } else if (screenWidth > 764 && mySwiper2 != undefined) {
                mySwiper2.destroy();
                mySwiper2 = undefined;
                jQuery('.swiper-wrapper').removeAttr('style');
                jQuery('.swiper-slide').removeAttr('style');
            }
        }

        //Swiper plugin initialization
        initSwiper();

        //Swiper plugin initialization on window resize
        $(window).on('resize', function () {
            initSwiper();

        });
});

Expected Behavior

I want the slider to behave the same way as it works on all other browsers eg. Chrome Safari Edge

Actual Behavior

Right now the active slider is not on the centre of the screen on mobile.

stale[bot] commented 4 years ago

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.

stale[bot] commented 3 years ago

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