JavaScript   

Fix screen width calculation issue in swiper slider

let customSlider = new Swiper('.post-slider', {
	direction: 'horizontal',
	spaceBetween: 12,
	slidesPerView: 3,
	pagination: {
		el: '.swiper-pagination',
	},
	on: {
		init() {
			setTimeout(() => {
				window.dispatchEvent(new Event("resize"))
			}, 200)
		},
	},
});
Need a helping hand in fixing your website issues?

If you are facing any problems in implementing these code snippets and tutorials, you can hire us to fix your website issues.

Hire Us