1{data.grid} 1{data.grid_lg} 0 1 5 15 30 //count childs var childs = $("#c{data.uid}.frame-carousel-1 .gallery-wrapper > .gallery-row").children().length; //initialize swiper when document ready if(childs > 1){ $('#c{data.uid}.frame-carousel-1 .gallery-wrapper').addClass( "swiper-container swiper-container-{data.uid}" ); $('#c{data.uid}.frame-carousel-arrows-1 .gallery-wrapper').append( '
' ); $('#c{data.uid}.frame-carousel-dots-1 .gallery-wrapper').append( '
' ); $('#c{data.uid}.frame-carousel-1 .gallery-wrapper > .gallery-row').addClass( "swiper-wrapper" ); $('#c{data.uid}.frame-carousel-1 .gallery-wrapper > div > div').addClass( "swiper-slide" ); var swiper = new Swiper('.swiper-container-{data.uid}', { slidesPerView: {defaultGrid-{data.uid}}, spaceBetween: {gridGutters}, slidesPerGroup: 1, loop: false, autoHeight: false, //enable auto height effect: 'slide', autoplay: { delay: 3500, }, grabCursor: true, keyboard: { enabled: true, }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, pagination: { el: '.swiper-pagination', dynamicBullets: ($('.swiper-container-{data.uid} .gallery-item').length > 1), }, // Responsive breakpoints breakpoints: { // when window width is >= 992px 992: { slidesPerView: {defaultGridLg-{data.uid}}, spaceBetween: {gridGutters} } } }); }