$(function(){ /* 메인 사업소개 */ $(".gallerybbs > tbody").addClass("swiper-container business-gallery-slide"); $(".gallerybbs > tbody > tr").addClass("swiper-wrapper"); $(".gallerybbs > tbody > tr > td").addClass("swiper-slide"); /* 메인 공지사항 카드형 */ $(".card-slide-con .board_output2").addClass("swiper-container card-slide"); $(".card-slide-con .board_output2 > tbody").addClass("swiper-wrapper"); $(".card-slide-con .board_output2 > tbody > tr").addClass("swiper-slide"); /* 메인 공지사항 롤링형 $(".rolling-con .board_output2").addClass("swiper-container rolling-slide"); $(".rolling-con .board_output2 > tbody").addClass("swiper-wrapper"); $(".rolling-con .board_output2 > tbody > tr").addClass("swiper-slide"); */ $(".business-slide-con").each(function(index){ var $this = $(this) var swiper = undefined; var slideNum = $this.find('.swiper-slide').length //슬라이드 총 개수 var slideInx = 0 sliderAct() function sliderAct(){ //슬라이드 인덱스 클래스 추가 $this.addClass("con0" + index); var mySwiper = new Swiper(".con0" + index + " .business-gallery-slide",{ slidesPerView: 4, slidesPerGroup: 1, initialSlide :slideInx, speed:1000, loop: true, autoplay: false, navigation: true, loopAdditionalSlides : true, observer: true, observeParents: true, breakpoints: { 1200: { slidesPerView: 3, //브라우저가 1024보다 클 때 }, 1023: { slidesPerView: 2, //브라우저가 1024보다 클 때 spaceBetween: 50, }, 767: { slidesPerView: 1, //브라우저가 1024보다 클 때 spaceBetween: 50, }, }, pagination: { // 호출(pager) 여부 el: ".swiper-pagination", //버튼을 담을 태그 설정 clickable: true, // 버튼 클릭 여부 }, navigation: { // 버튼 nextEl: ".con0" + index + " .business-next-arrow", prevEl: ".con0" + index + " .business-prev-arrow", }, on: { activeIndexChange: function () { slideInx = this.realIndex; //현재 슬라이드 index 갱신 } }, }) } }) var mySwiper = new Swiper ('.card-slide', { slidesPerView: 5, slidesPerGroup: 1, loop: true, autoplay: false, navigation: true, loopAdditionalSlides : true, observer: true, observeParents: true, breakpoints: { 1200: { slidesPerView: 3, //브라우저가 1024보다 클 때 spaceBetween: 50, }, 1023: { slidesPerView: 2, //브라우저가 1024보다 클 때 spaceBetween: 50, }, 767: { slidesPerView: 1, //브라우저가 1024보다 클 때 spaceBetween: 50, }, }, pagination: { // 호출(pager) 여부 el: ".swiper-pagination", //버튼을 담을 태그 설정 clickable: true, // 버튼 클릭 여부 }, navigation: { // 버튼 nextEl: ".main-notice-con .notice-next-arrow", prevEl: ".main-notice-con .notice-prev-arrow", }, }); $(".rolling-con .board_output2 > tbody").each(function(){ var $noticeRollingSlide = $(this); $noticeRollingSlide.slick({ observer: true, observeParents: true, adaptiveHeight: true, vertical:true, autoplay:true, arrows: true, dots: false, adaptiveHeight: true, speed: 1000, infinite : true, easing: 'easeInOutQuint', prevArrow: '', nextArrow: '', }) }) $(".main-visual-slide").each(function(){ var $visualSlide = $(this); $visualSlide.slick({ slidesToShow: 1, autoplay:true, dots: true, arrows: true, speed: 1000, infinite : true, easing: 'easeInOutQuint', prevArrow: '.main-visual-controls .prev-btn', nextArrow: '.main-visual-controls .next-btn', }) }) }) $(function(){ /* 메인 사업소개 슬라이드 탭 영역 */ $(".business-slide-con").addClass("hide") $(".business-slide-con").eq(0).removeClass("hide") $(".business-tab-con").find("li").click(function(){ var t = $(this).index(); $(".business-tab-con").find("li").removeClass("active") $(this).addClass("active") $(".business-slide-con").addClass("hide"); $(".business-slide-con").eq(t).removeClass("hide") }) /* 메인 사업소개 슬라이드 공지사항 텍스트 추가 */ var galleyItem = $(".slide-gallery").find(".swiper-slide"); $(galleyItem).each(function(){ var urlTest = $(this).find(".board_output_gallery_img").find("a").prop("href") $(this).find("tbody").children("tr").eq(1).find("td").append("자세히 보기") $(this).find("tbody").children("tr").eq(1).find("a").attr("href", urlTest) }) /* 메인 공지사항 카드형 텍스트 추가 및 무한루프 추가 설정 */ var noticeCard = $(".card-slide-con").find(".swiper-slide"); $(noticeCard).each(function(){ if($(this).find("td").children().length == 0){ $(this).remove(); } $(this).find("td").eq(2).find("a").append("자세히 보기") }) /* 메인 공지사항 롤링 내용 없는 부분 삭제 */ /*$(".rolling-con").find(".slick-cloned").remove();*/ /* 메인 비전 탭 영역 */ $(".vision-tab-con").find("li").click(function(){ var menuIdx = $(this).attr("data-menu"); var index = $(this).index(); $(".vision-tab-con").find("li").removeClass("active"); $(this).addClass("active") $(".vision-rt-con").find(".vision-txt-con").hide(); $(".vision-rt-con").find(".vision-txt-con").eq(index).fadeIn(); $("#vision-bg-con").removeClass(); $("#vision-bg-con").addClass("bg-" + menuIdx) }) })