$(function(){ // Fullpage var myFullpage = $("#fullpage").fullpage({ navigation: true, navigationPosition: "right", navigationTooltips: ["HOME", "ABOUT", "PRODUCT", "R&D", "CUSTOMER"], showActiveTooltip: true, scrollOverflow:true, touchSensitivity: 20, //normalScrollElements: ".report_slide", onLeave: function(origin, destination, direction){ var windowWidth = $(window).width(); $(window).resize(function(){ if(windowWidth > 1279){ if(destination == 2){ $("body").addClass("blk"); $("body").removeClass("textblk"); }else if(destination == 3){ $("body").removeClass("blk"); $("body").removeClass("textblk"); }else{ $("body").removeClass("blk"); $("body").removeClass("textblk"); } }else{ $("body").removeClass("blk"); $("body").removeClass("textblk"); } }).resize(); if(destination === 1){ $(".top_btn").fadeOut(); }else{ $(".top_btn").fadeIn(); } }, afterLoad: function(origin, destination, direction){ if(destination === 2){ $(".section2").addClass("in-view"); }else if(destination === 3){ $(".section3").addClass("in-view"); }else if(destination === 4){ $(".section4").addClass("in-view"); }else if(destination === 5){ $(".section5").addClass("in-view"); } } }); $(".top_btn").click(function(){ $.fn.fullpage.moveTo(1); }); //메인 슬라이드 SCROLL 버튼 $(".scroll_btn").on("click", function(){ $.fn.fullpage.moveSectionDown(); }); //브라우저 리사이즈시 메인 슬라이드 조절 $(window).resize(function(){ var windowWidth = $(window).width(), windowHeight = $(window).height(), adjHeight = windowHeight; $(".main_slide").css({ "width": windowWidth + "px", "height": adjHeight + "px" }); if(windowWidth > 767){ $(".section2, .section4").addClass("fp-noscroll"); }else{ $(".section2, .section4").removeClass("fp-noscroll"); } }).resize(); $(document).ready(function(){ var bxslider = $(".bxslide").bxSlider({ mode: 'fade', pause:5000, speed: 500, auto: true, infiniteLoop: true, controls: false, pager: true, onSliderLoad: function(){ $(".bxslide li:eq(0) .txt").addClass("on"); }, onSlideAfter: function(slideElement, oldIndex, newIndex){ //console.log("old"+oldIndex+", new"+newIndex); $(".bxslide li:eq("+oldIndex+") .txt").removeClass("on"); $(".bxslide li:eq("+newIndex+") .txt").addClass("on"); bxslider.stopAuto(); bxslider.startAuto(); } }); }); $(window).load(function(){ //Section3 제품 슬라이드 data값 var $status = $(".slide-count-wrap"); var $slickElement = $(".pr_slide"); $slickElement.on("init reInit afterChange", function(event, slick, currentSlide, nextSlide){ var i = (currentSlide ? currentSlide : 0) + 1; $status.html(''+i+'' + ' / ' + ''+slick.slideCount+''); /*var $thisSlide = $(this).find(".slick-active").children(".img"); var $thisData = $thisSlide.data(); var $dataArray = new Array(); $dataArray.push($thisData); //console.log($dataArray[0].title); var $boxTitle = $(".section3 .text_box h4"); var $boxNumber = $(".section3 .text_box .number"); var $boxText = $(".section3 .text_box p"); var $boxLink = $(".section3 .text_box .pr_btn"); $boxTitle.text($dataArray[0].title); $boxNumber.text($dataArray[0].number); $boxText.text($dataArray[0].text); $boxLink.attr("href", $dataArray[0].link);*/ }); //Section3 제품 슬라이드 $(".pr_slide").slick({ infinite: true, slidesToShow: 1, slidesToScroll: 1, autoplay: false, autoplaySpeed: 2000, arrows: true, centerMode: true, centerPadding: "22%", prevArrow: ".slick_prev", nextArrow: ".slick_next", responsive: [ { breakpoint: 1700, settings: { centerPadding: "20%" } }, { breakpoint: 1350, settings: { centerPadding: "15%" } }, { breakpoint: 1279, settings: { centerPadding: "7%" } }, { breakpoint: 767, settings: { centerPadding: 0 } } ] }); //Media report 슬라이드 $(".report_slide").slick({ infinite: false, slidesToShow: 3, slidesToScroll: 3, autoplay: true, arrows: false, dots:true, responsive: [ { breakpoint: 767, settings: { slidesToShow: 1, centerMode: true, dots:false, centerPadding: "20%" } } ] }); }); });