$(function(){
startJs();
allMenuJs();
layerPopJs();
});
$(document).on('click', 'a[href="#none"]', function(e) {
e.preventDefault();
});
function startJs(){
//기본js
$(document).on('click', 'a[href="#none"]', function(e) {e.preventDefault()});
if($('html').is('.ie67, .ie7, .ie8, .ie9')) {
$('div.ie_alert_text').show().html('현재 사이트는 IE9 미만의 하위브라우저를 지원하지 않습니다.
브라우저를 최신 버전으로 업데이트해 주세요.');
}
WebFont.load({google: {families: ['Noto Sans KR', 'Montserrat']}});
/*메뉴호버*/
$("#nav>ul>li").mouseenter(function(){
$(this).find(".dep2").stop().slideDown(500 , 'easeInOutQuad');
});
$("#nav>ul>li").mouseleave(function(){
$("#nav .dep2").stop().hide();
});
/* scroll */
var $animation_elements = $('.ani');
var $window = $(window);
function check_if_in_view() {
var window_height = $window.height();
var window_top_position = $window.scrollTop();
var window_bottom_position = (window_top_position + window_height);
$.each($animation_elements, function() {
var $element = $(this);
var element_height = $element.outerHeight();
var element_top_position = $element.offset().top+200;
var element_bottom_position = (element_top_position + element_height);
//console.log(element_top_position);
//check to see if this current container is within viewport
if ((element_bottom_position >= window_top_position) &&
(element_top_position <= window_bottom_position)) {
$element.addClass('in-view');
} else {
//$element.removeClass('in-view');
}
});
}
$window.on('scroll resize', check_if_in_view);
$window.trigger('scroll');
}
function allMenuJs() {
$(document).on("click",".hamburger_btn",function(){
$("#allmenu").fadeIn().addClass("on");
$("#contents").addClass("on");
$("#bg").fadeIn();
});
$(document).on("click","#allmenu .close",function(){
$("#allmenu").fadeOut().removeClass("on");
$("#contents").removeClass("on");
$("#bg").fadeOut();
});
/*태블릿모바일사이즈*/
$(window).resize(function(){
$("#bg").fadeOut();
$("#allmenu").hide();
$("#allmenu, #contents").removeClass('on');
vw = $(window).width();
if(vw < 1279){
$("#allmenu .inner .dep1 .dep2").hide();
$("#allmenu .inner .dep1 h2").removeClass("act");
}else{
$("#allmenu .inner .dep1 .dep2").show();
$("#allmenu .inner .dep1 h2").removeClass("act");
}
}).resize();
$("#allmenu .inner .dep1 h2").click(function(){
if($(this).attr("class") == "act"){
$(this).next(".dep2").slideUp(300);
}else{
$(this).next(".dep2").slideDown(300);
}
$(this).toggleClass("act");
$(this).parents(".dep1").siblings().find("h2").removeClass("act");
$(this).parents(".dep1").siblings().find(".dep2").slideUp();
});
}
function layerPopJs() {
//레이어팝업
var bg = $("#bg");
$(document).on('click','#popup .close ', function () {
bg.fadeOut();
$('#popup div.inner').html('');
$('#popup').hide();
});
$(document).on('click',' .privacy_btn', function () {
var ClassName = $(this).data('link');
bg.show();
$('#popup').show();
$('#popup').html(
'