$(function(){
$('#fullpage').fullpage({
scrollingSpeed: 700,
lockAnchors: true,
verticalCentered: false,
recordHistory: false,
// ** 페이지를 불러온 후
afterLoad : function(anchorLink, index){
$('.section0'+index).addClass('ani');
switch(index) {
case 1:
$('header').addClass('fp_white');
$('header').removeClass('fp_black');
break;
default:
$('header').removeClass('fp_white');
$('header').addClass('fp_black');
break;
}
},
afterRender : function(){
$('#side_nav li:eq(0)').addClass('on');
},
// ** 페이지를 떠날때
onLeave : function(anchorLink, destination, direction, index){
$('#side_nav li').removeClass('on');
if(destination === 1){
$(".page_top").fadeOut();
}else{
$(".page_top").fadeIn();
}
$('#side_nav li:nth-child('+destination+')').addClass('on');
if(anchorLink == 5 && direction =='down') {
$('#side_nav').css('opacity','0');
}
if(anchorLink == 6 && direction =='up') {
$('#side_nav').delay(500).css('opacity','1');
}
},
});
$(document).on('click', '#side_nav li', function () {
var $selector = $('#side_nav li');
var Anchors = $(this).index();
$selector.removeClass('on');
$selector.eq(Anchors).addClass('on');
$.fn.fullpage.moveTo(Anchors+1);
return false;
});
//slide
bx_visual = $('.section01 .bx_visual').bxSlider({
//mode: 'horizontal',
mode: 'fade',
auto:true,
pause:5500, //멈춤 대기
speed: 400, // 이동 속도
pager:true,
controls: false,
infiniteLoop: true,
autoControls : true,
stopAutoOnClick: true,
startText: '',
stopText: '',
onSliderLoad: function($currentIndex){
$('.section01 .bx_visual>div:eq(0)').addClass("on");
},
onSlideAfter: function($slideElement, oldIndex, newIndex){
$('.section01 .bx_visual>div:eq('+oldIndex+')').removeClass("on");
$('.section01 .bx_visual>div:eq('+newIndex+')').addClass("on").siblings().removeClass("on");
},
onSlideBefore: function($slideElement, oldIndex, newIndex){
if(newIndex != 2) {
}
},
});
$(document).on("click",".bx-next, .bx-prev, .bx-pager-link",function(){
bx_visual.stopAuto();
bx_visual.startAuto();
})
if($(window).width() <= 1600){
$('.section03 .list_wrap').slick({
speed: 700,
slidesToShow: 1,
variableWidth: true,
infinite: false,
arrows: false,
});
}
$(window).on('resize', _.debounce(function() {
if($(window).width() <= 1600){
$('.section03 .list_wrap').slick({
speed: 700,
slidesToShow: 1,
variableWidth: true,
infinite: false,
arrows: false,
});
}else{
$('.section03 .list_wrap').slick('unslick');
}
}, 200));
});