$(document).on('click', 'a[href="#none"]', function(e) {
e.preventDefault();
});
//기본js
function startJs(){
$(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']}});
//모바일구분
$(window).resize(function(){
windowWidth = $(window).width();
if(windowWidth < 1400){
$('body').removeClass('pc');
$('body').addClass('mobile');
}else{
$('body').addClass('pc');
$('body').removeClass('mobile');
}
}).resize();
function resetHeight(){
$('#scroll_wrap').css('height', $(window).innerHeight());
}
window.addEventListener("resize", resetHeight);
resetHeight();
}
function popup() {
//레이어팝업
var bg = $("#bg");
$(document).on('click',' #bg, .close ', function () {
bg.fadeOut();
$('div[id*="-popup"] div.inner').html('');
$('div[id*="-popup"]').hide();
$(".pop").fadeOut();
$(".pop form")[0].reset();
$(".pop form")[1].reset();
$(".pop form")[2].reset();
$(".pop option:eq(0)").prop("selected", true);
$(".type1_con").show();
$('.pop_form').removeClass('type2');
$(".pop .conwrap form .privacy_sec").show();
});
$(document).on('click','.layer-',
function () {
var ClassName = $(this).data('link');
bg.show();
$('#layer-popup').show();
$('#layer-popup').html(
'
'+
''+
'
'
);
//foot 메뉴 클릭시
switch (ClassName) {
case "privacy1":
$("#layer-popup div.inner").load("/_privacy1.php");
break;
case "terms":
$("#layer-popup div.inner").load("/_terms.php");
break;
}
}); //click
}
function custom_cursor(){
var $cursor_primary = $('#custom_cursor');
var $circle = $cursor_primary.find('.custom_cursor_circle');
$('body').mousemove(function(e) {
tl.to($cursor_primary, 0.7, {opacity:1, x: e.clientX,y: e.clientY,ease: Power3.easeOut});
});
$(document).on('mouseenter', '.custom_mousemove', function(){
$(this).addClass('move_on');
var $this = $(this);
var words = ( $this.data('hover') != undefined ) ? $this.data('hover') : '';
var size = ( $this.data('size') != undefined ) ? $this.data('size') : '100%';
if( $this.hasClass('small_h') ){
$cursor_primary.addClass('small');
}else{
$cursor_primary.removeClass('small');
}
tl.killTweensOf($circle);
tl.to($circle, .3, {width: size,height: size,autoAlpha: 1,ease: Power0.easeNone});
});
$(document).on('mouseleave', '.custom_mousemove', function(){
var $this = $(this);
tl.killTweensOf($circle);
tl.to($circle, .2, {width: '15px',height: '15px',ease: Power0.easeNone});
$(this).removeClass('move_on');
});
$('.follow_btn').each(function(){
var $this = $(this);
var $pointer = $this.find('.i');
var pointer_size = ( $this.data('size') != undefined ) ? $this.data('size') : parseInt($this.width());
var $pointer_extend = null;
if( $this.find('.follow').length > 0 ) {
$pointer_extend = $this.find('.follow');
}
$this.on({
mouseenter: function(){
$this.bind('mousemove', function(e){
var center_x = $pointer.offset().left + $pointer.width()/10;
var center_y = $pointer.offset().top + $pointer.height()/10;
var tween_x = e.pageX - center_x;
var tween_y = e.pageY - center_y;
if( $pointer_extend != null ) {
tl.to($pointer_extend, .3, {x: tween_x / 5.0,y: tween_y /5.0,ease: Power3.easeOut});
}
});
},
mouseleave: function(){
if( $pointer_extend != null ) {
tl.to($pointer_extend, .2, {x: 0,y: 0,ease: Power0.easeNone});
}
$this.unbind('mousemove');
}
});
});
}
function allMenuJs(){
chkNum = 0;
$(".hamburger_btn").click(function(){
if(chkNum==0){
//$("#header").addClass("wh");
$(this).addClass("open");
$(".allmenu").removeClass("close");
$(".allmenu").addClass("open");
chkNum = 1;
}else{
//$("#header").removeClass("wh");
$(this).removeClass("open");
$(".allmenu").removeClass("open");
$(".allmenu").addClass("close");
chkNum = 0;
}
});
$(document).on("click",".mobile .allmenu .inner>ul>li",function(){
if($(this).attr("class") == "act"){
$(this).find("ul").slideUp();
}else{
$(this).find("ul").slideDown();
}
$(this).toggleClass("act");
$(this).siblings("li").removeClass("act");
$(this).siblings("li").find("ul").slideUp();
})
}
function menuJs(){
$("#nav>ul>li").mouseenter(function(){
var menuNum = $(this).index()+1;
if(menuNum === menuNum){
$('header').addClass('dark on');
$('header h1.logo').addClass('dark');
$(".lnb").stop().hide().removeClass('on');
$(".lnb.sub"+menuNum+"").stop().show();
tl.staggerFromTo($(".lnb.sub"+menuNum+" .dep2"), 0.4, {opacity:0, x:'10px'}, {opacity: 1,x:'0%', delay:0.0, ease: Power1.easeInOut});
}else{
$(".lnb").stop().hide();
}
});
$("#nav").mouseleave(function(){
$(".lnb").stop().hide();
$('header h1.logo').removeClass('dark');
if($('header').hasClass('fix_style')){
$('header').removeClass('on');
}else{
$('header').removeClass('dark on');
}
});
//언어선택 셀렉박스
$(document).on("click","header .language > button",function(){
$(this).parent(".language").toggleClass("open");
if($(this).parent(".language").hasClass("open")){
$(".language").find("ul").stop().slideDown(500);
}else{
$(".language").find("ul").stop().hide();
}
});
$("header .language ul").mouseleave(function(){
$("header .language").removeClass("open");
$(this).stop().hide();
});
}
$(function(){
tl = TweenMax;
startJs();
popup();
allMenuJs();
menuJs();
custom_cursor();
//개인정보처리방침 팝업
$(".privacy_btn").click(function(){
$(".privacy_pop,#bg").show();
});
$(".privacy_pop .btn_x").click(function(){
$(".privacy_pop,#bg").hide();
});
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;
var element_bottom_position = (element_top_position + element_height);
//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 formSubmit() {
if ($(".form_wrap #f_name").val() == "") {
alert("Enter your name");
$(".form_wrap #f_name").focus();
return false;
}
if ($(".form_wrap #f_email").val() == "") {
alert("Enter your Email");
$(".form_wrap #f_email").focus();
return false;
}
if ($(".form_wrap #f_company").val() == "") {
alert("Enter your Company");
$(".form_wrap #f_company").focus();
return false;
}
if ($(".form_wrap #f_country").val() == "") {
alert("Enter your Country");
$(".form_wrap #f_country").focus();
return false;
}
if ($(".form_wrap #f_inquiries").val() == "") {
alert("Enter your Inquiries");
$(".form_wrap #f_inquiries").focus();
return false;
}
if ($(".agr_chk #privacy_check:checked").length == 0) {
alert("Please agree to the personal information processing policy.");
$(".agr_chk #privacy_check").focus();
return false;
}
return true;
}