yanghyo 3 days ago
클래스 메인 공지사항 swiper 수정
@c97dbdbc7a2fd70d5d3985c576c5321901999f1b
resources/front/site/SITE_00000/js/common-custom2.js
--- resources/front/site/SITE_00000/js/common-custom2.js
+++ resources/front/site/SITE_00000/js/common-custom2.js
@@ -91,56 +91,11 @@
                     },
                 });
             });
-        },
-        noticeSwiper: function (obj) {
-           return this.each(function () {
-                var $container = $(this);
-                var $el = $container.find('.swiper');
-                var $btnPrev = $container.find('.btn-prev')[0];
-                var $btnNext = $container.find('.btn-next')[0];     
-                var $btnPlayStop = $container.find('.swiper-btn-playstop-toggle')[0];       
-                var isPaused = false; // 재생 상태 변수 (컨테이너별)
-
-                var swiper = new Swiper($el[0], {
-                    preloadImages: true,
-                    // autoplay: {
-                    //     delay: 3000,
-                    //     disableOnInteraction: false,
-                    // },
-                    effect: "fade", 
-                    fadeEffect: {
-                        crossFade: true, 
-                    },
-                    loop: true,
-                    speed: 1000,
-                    slidesPerView: 1,
-                    initialSlide: 0,
-                    watchSlidesProgress: true,
-                    navigation: {
-                        prevEl: $btnPrev,
-                        nextEl: $btnNext
-                    },
-                });
-
-                // 재생/중지 버튼
-                $($btnPlayStop).on('click', function () {
-                    if (isPaused) {
-                        swiper.autoplay.start();
-                        $(this).removeClass('is-stop').text('중지');
-                        isPaused = false;
-                    } else {
-                        swiper.autoplay.stop();
-                        $(this).addClass('is-stop').text('재생');
-                        isPaused = true;
-                    }
-                });
-            });
-        },
+        }
     });
 })(jQuery);
 
 $(document).ready(function () {   
     $('.mn-visual').mnVisualSwiper();
     $('.mn-course .mn-cont').mnCourseSwiper();
-    $('.notice-swiper-area').noticeSwiper();
 });
(파일 끝에 줄바꿈 문자 없음)
resources/front/site/SITE_00000/js/common.js
--- resources/front/site/SITE_00000/js/common.js
+++ resources/front/site/SITE_00000/js/common.js
@@ -1048,6 +1048,12 @@
                     thumbs: {
                         swiper: imgThumbSwiper,
                     },
+                    slidesPerView: 1.1,
+                    spaceBetween: 8,
+                    breakpoints: {
+                        767: { slidesPerView: 1.2 },
+                        1279: { slidesPerView: 1}
+                    } 
                 });
             });
         },
@@ -1162,7 +1168,52 @@
                 });
                 
             });
-        }
+        },
+
+        classMnNoticeSwiper: function (obj) {
+            return this.each(function () {
+                var $container = $(this);
+                var $el = $container.find('.swiper');
+                var $btnPrev = $container.find('.swiper-button-prev')[0];
+                var $btnNext = $container.find('.swiper-button-next')[0];     
+                var $btnPlayStop = $container.find('.swiper-btn-playstop-toggle')[0];       
+                var isPaused = false; // 재생 상태 변수 (컨테이너별)
+
+                var swiper = new Swiper($el[0], {
+                    preloadImages: true,
+                    // autoplay: {
+                    //     delay: 3000,
+                    //     disableOnInteraction: false,
+                    // },
+                    effect: "fade", 
+                    fadeEffect: {
+                        crossFade: true, 
+                    },
+                    loop: true,
+                    speed: 1000,
+                    slidesPerView: 1,
+                    initialSlide: 0,
+                    watchSlidesProgress: true,
+                    navigation: {
+                        prevEl: $btnPrev,
+                        nextEl: $btnNext
+                    },
+                });
+
+                // 재생/중지 버튼
+                $($btnPlayStop).on('click', function () {
+                    if (isPaused) {
+                        swiper.autoplay.start();
+                        $(this).removeClass('is-stop').text('중지');
+                        isPaused = false;
+                    } else {
+                        swiper.autoplay.stop();
+                        $(this).addClass('is-stop').text('재생');
+                        isPaused = true;
+                    }
+                });
+            });
+        },
     });
 })(jQuery);
 
@@ -1204,7 +1255,8 @@
     $('.thumb-swiper').thumbSwiper();
     $('.img-swiper-area').imgSwiper();
     $('.mn-popup-area').mnPopupSwiper();
-
+    $('.notice-swiper-area').classMnNoticeSwiper();
+    
     checkIsSticky();
     window.onscroll = () => {
         checkIsSticky();
Add a comment
List