When I initialize the slider in angular2 the slider not loads sometimes and after resizing it works fine
setTimeout(function() {
let slider = new Swiper('#property-slider', {
'nextButton' : '.swiper-button-next',
'prevButton' : '.swiper-button-prev',
'slidesPerView' : 4,
'spaceBetween' : 20,
'loop' : true,
'preventClicks': false,
'breakpoints' : {
819: {
slidesPerView: 2
},
509: {
slidesPerView: 1
}
}
});
}, 500)
can someone please give me some solution for it why this is happening