$(document).ready(function () { const swiperMainBizMenu = ['½´ÆÛ ¿£Áö´Ï¾î¸µ', 'ģȯ°æ', '¿£Áö´Ï¾î¸µ', '¹ü¿ë'] const swiperMainBiz = new Swiper('.swiperMainBiz', { // If we need pagination pagination: { el: '.swiperMainBizPaging', clickable: true, renderBullet: function (index, className) { return '' + (swiperMainBizMenu[index]) + ''; }, }, effect: 'slide', autoplay: { delay: 4000, }, slidesPerView: 1, spaceBetween: 5, loop: true, breakpoints: { 1200: { autoHeight: false, }, }, on: { resize: function () { swiperMainBiz.changeDirection(getDirection()); }, }, }) const swiperMainGallery = new Swiper('.swiperMainGallery', { slidesPerView: 2, spaceBetween: 10, direction: getDirection(), autoplay: { delay: 3000, disableOnInteraction: false, }, loop: true, breakpoints: { 1199: { slidesPerView: 4, spaceBetween: 20, }, 699: { slidesPerView: 3, spaceBetween: 20, }, 499: { slidesPerView: 2, spaceBetween: 20, }, }, on: { resize: function () { swiperMainGallery.changeDirection(getDirection()); }, }, }); function getDirection() { var windowWidth = window.innerWidth; var direction = window.innerWidth <= 0 ? 'vertical' : 'horizontal'; return direction; } });