swiper

Open full view…

imagesReady event not fired

sebytab
Sat, 13 Jan 2018 20:56:05 GMT

I have the same issue https://stackoverflow.com/questions/47187155/swipers-imagesready-event-not-firing but i can't fix it. I'm using 4.0.7 version and I also tried with 4.1.0. I need to catch the event to adapt slide div to content width (remove space between slides) https://github.com/nolimits4web/Swiper/issues/1259 My configuration: var sliderOptions = { direction: 'horizontal', initialSlide: 0, speed: 300, effect: 'slide', slidesPerView: 'auto', // Images preloadImages: true, updateOnImagesReady: true, // Scrollbar scrollbar: { el: '.slideshow .scrollbar', hide: false, draggable: true, }, // Autoplay autoplay: { delay: 1000, stopOnLast: false, disableOnInteraction: false }, // Dragging grabCursor: true, mousewheel: true, keyboard: true, // Events on: { imagesReady: function () { console.log('slider images loaded'); var wrapper = document.getElementsByClassName('swiper-wrapper')[0]; for (var slide of wrapper.children) { slide.style.width = getComputedStyle(slide.children[0])['width']; } } }