$(function(){
// 레이어팝업
var bg = $("#bg");
$(document).on('click',' #bg, .close ', function () {
bg.fadeOut();
$('#video-popup div.inner').html('');
$('#video-popup').hide();
});
$('.play_btn').on('click', function(){
var dataUrl = $(this).attr('data-url');
if(dataUrl){
bg.show();
$('#video-popup').show();
$('#video-popup').html(
'
'+
''+
'
'
);
$('#video-popup div.inner').html(dataUrl);
}else {
alert('준비중 입니다.');
}
});
});
$(function(){
$('#fullpage').fullpage({
scrollingSpeed: 700,
lockAnchors: true,
verticalCentered: false,
recordHistory: false,
// ** 페이지를 불러온 후
afterLoad : function(anchorLink, index){
$('.section0'+index).addClass('ani');
$('header, #side_nav').addClass('motion');
switch(index) {
case 1: case 4:
$('#wrap').addClass('theme_white');
$('#wrap').removeClass('theme_dark');
break;
default:
$('#wrap').removeClass('theme_white');
$('#wrap').addClass('theme_dark');
break;
}
if(index != 1){
$('header').addClass('on');
$('.scroll_btn.top_btn').show();
$('.scroll_btn.down_btn').hide();
}else{
$('header').removeClass('on');
$('.scroll_btn.top_btn').hide();
$('.scroll_btn.down_btn').show();
}
},
// ** 페이지를 떠날때
onLeave : function(anchorLink, destination, direction, index){
$('#side_nav li').removeClass('on');
//현재 목적지번호와 같은 li를 on
$('#side_nav li:nth-child('+destination+')').addClass('on');
if(destination === 1){
$(".page_top").fadeOut();
}else{
$(".page_top").fadeIn();
}
if(anchorLink == 6 && direction =='down') {
$('#side_nav').css('opacity','0');
$('.scroll_btn').css('opacity','0');
}
if(anchorLink == 7 && direction =='up') {
$('#side_nav').css('opacity','1');
$('.scroll_btn').css('opacity','1');
}
},
});
$('.top_btn').click(function() {
$.fn.fullpage.moveTo(1);
});
$('.down_btn').click(function() {
$.fn.fullpage.moveTo(2);
});
$('#top_btn').click(function() {
$.fn.fullpage.moveTo(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;
});
});
//main slide
function mainSlide(){
$('.section01 .main_slide').slick({
autoplay:true,
infinite: true,
speed: 600,
fade: true,
touchMove:false,
autoplaySpeed:5000,
slidesToShow: 1,
slidesToScroll: 1,
pauseOnHover:false,
pauseOnFocus:false,
cssEase: 'ease-in',
prevArrow: $('.section01 .slide_navigation').find('.prev'),
nextArrow: $('.section01 .slide_navigation').find('.next'),
dots: true,
});
if(typeof $.fn.Slick === 'undefined'){
$('.main_slide').find('.v01').addClass('on');
$('.main_slide').on('beforeChange', function(event, slick, currentSlide, nextSlide){
$('.main_slide').find('div[class*="v0"]').removeClass('on');
$('.main_slide').find('.v0'+(nextSlide+1)).addClass('on');
});
}
//section03
if($(window).width() <= 1280){
$('.section04 .list_wrap').slick({
speed: 300,
slidesToShow: 3,
dots: true,
arrows: false,
centerMode: true,
variableWidth: true,
});
}
$(window).on('resize', _.debounce(function() {
if($(window).width() <= 1280){
$('.section04 .list_wrap').slick({
speed: 300,
slidesToShow: 3,
dots: true,
arrows: false,
centerMode: true,
variableWidth: true,
});
}else{
$('.section04 .list_wrap').slick('unslick');
}
}, 0));
$('.section06 .notice .slide_list ul').slick({
autoplay:false,
infinite: false,
speed: 400,
touchMove:false,
pauseOnHover:false,
pauseOnFocus:false,
rows:2,
slidesToShow: 1,
slidesToScroll: 1,
cssEase: 'ease-in',
prevArrow: $('.section06 .notice .slide_navigation').find('.prev'),
nextArrow: $('.section06 .notice .slide_navigation').find('.next'),
});
$('.section06 .news .slide_wrap').slick({
autoplay:false,
infinite: false,
variableWidth: true,
speed: 400,
touchMove:false,
slidesToShow: 3,
slidesToScroll: 1,
pauseOnHover:false,
pauseOnFocus:false,
cssEase: 'ease-in',
prevArrow: $('.section06 .news .slide_navigation').find('.prev'),
nextArrow: $('.section06 .news .slide_navigation').find('.next'),
responsive: [
{
breakpoint: 1430,
settings: {
variableWidth: false,
}
},
{
breakpoint: 1280,
settings: {
variableWidth: false,
slidesToShow: 2,
}
},
]
});
}
$(function(){
mainSlide();
});