// JavaScript Document $(function(){ $(".menu li").hover(function(){ $(this).addClass("on"); $(this).children(".sub").addClass("active"); },function(){ $(this).removeClass("on"); $(this).children(".sub").removeClass("active"); }); $(".menu .cls").hover(function(){ $(this).addClass("on"); $(this).children(".sub").addClass("active"); },function(){ $(this).removeClass("on"); $(this).children(".sub").removeClass("active"); }); $('.m-menubtn').on('click', function() { if (!$(this).hasClass('active')) { $(this).addClass('active'); $('.sub-menubg').fadeIn(); $('.m-menu').fadeIn(); $('.m-menu').find('.menu_li').addClass('animate'); $('body').addClass('ovh all'); }else{ $(this).removeClass('active'); $('.sub-menubg').fadeOut(); $('.m-menu').fadeOut(); $('.m-menu').find('.menu_li').removeClass('animate'); $('body').removeClass('ovh all'); } }); $('.m-menu .arrow').on('click', function() { if (!$(this).parent('.menu_li').hasClass('active')) { $(this).parent('.menu_li').addClass('active'); $(this).next('.subnav').slideDown().parent().siblings().children('.subnav').slideUp(); $(this).parent().siblings().removeClass('active'); }else{ $(this).parent('.menu_li').removeClass('active'); $(this).next('.subnav').slideUp(); } }); $('.lang').hover(function(){ $(this).children(".sub").addClass('on'); },function(){ $(this).children(".sub").removeClass('on'); }) /*$('.i-newslist li').first().addClass('active'); $('.i-newslist li').first().find('.intro').show(0); $('.i-newslist .tit').on('click', function() { if (!$(this).parents('.i-newslist li').hasClass('active')) { $(this).parents('.i-newslist li').addClass('active'); $(this).next('.intro').slideDown().parents('.i-newslist li').siblings().find('.intro').slideUp(); $(this).parents('.i-newslist li').siblings().removeClass('active'); }else{ $(this).parents('.i-newslist li').removeClass('active'); $(this).next('.intro').slideUp(); } });*/ $('.procon .itemlist').first().addClass('active'); $('.procon .itemlist').first().find('.conn').show(0); $('.procon .itemlist .tit').on('click', function() { if (!$(this).parents('.itemlist').hasClass('active')) { $(this).parents('.itemlist').addClass('active'); $(this).next('.conn').slideDown().parents('.itemlist').siblings().find('.conn').slideUp(); $(this).parents('.itemlist').siblings().removeClass('active'); }else{ $(this).parents('.itemlist').removeClass('active'); $(this).next('.conn').slideUp(); } }); $(".backtop").on("click",function(){ $('html, body').animate({scrollTop: 0},300);return false; }) }) $(function () { $('.protab a').on("click",function(){ var obj = $(this), paren = obj.parents('.products-bot'); var index=$(this).index(); $(this).addClass('active').siblings().removeClass('active'); paren.find('.procon .itembox').removeClass('active'); paren.find('.procon .itembox').eq(index).addClass('active'); }) }) $(function(){ $('.header .search-btn').on('click', function() { if(!$(this).hasClass('active')){ $(this).addClass('active'); $('.search-alert').stop().fadeIn(300); }else{ $(this).removeClass('active'); $('.search-alert').stop().fadeOut(0); } }); $(".search-alert .close").on('click', function() { $(".search-alert").stop().hide(); $('.header .search-btn').removeClass('active'); }); $('.recruit-li1').on('click', function() { if (!$(this).hasClass('active')) { $(this).addClass('active').parent().siblings().children('.recruit-li1').removeClass('active'); $(this).next('.recruit-li2').slideDown().parent().siblings().find('.recruit-li2').slideUp(); }else{ $(this).removeClass('active'); $(this).next('.recruit-li2').slideUp(); } }); }); window.onload=function(){ var $hoveranim = $('.hoveranim'); $($hoveranim).each(function () { var $this = $(this); var $textbox = $this.find('.textbox'); var $image = $this.find('.image'); var botHeight = $this.find('.textbox .text_bot').outerHeight(); var imgHeight = $image.find('img').outerHeight(); var textboxHeight = $textbox.outerHeight(); $(this).hover(function () { $image.css({"height":imgHeight - botHeight,"transform": "translate3d(0px, "+-botHeight/3+"px, 0px)"}); $textbox.css({'height': textboxHeight + botHeight}) }, function () { $image.css({'height':imgHeight, 'transform': 'translate3d(0px, 0px, 0px)'}) $textbox.css({'height': textboxHeight}) }); }); } /*$(function(){ $(window).scroll(function(){ if ($(window).scrollTop() > 0){ $(".header").addClass("header-scroll"); }else{ $(".header").removeClass("header-scroll"); } }) $(window).scroll(function(){ if ($(window).scrollTop() > $(".nbanner").height() && $(".pro_nav .pro_nav_fix").length == 1) { $(".pro_nav_fix").addClass("scroll"); }else{ $(".pro_nav_fix").removeClass("scroll"); } }) }) */ $(document).ready(function() { $('a[href*=#],area[href*=#]').click(function() { if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { var $target = $(this.hash); $target = $target.length && $target || $('[name=' + this.hash.slice(1) + ']'); if ($target.length) { var targetOffset = $target.offset().top; $('html,body').animate({ scrollTop: targetOffset -160 }, 500); return false; } } }); });