var mainScreen; /****************************************** / @ ready ±âº» À̺¥Æ® *******************************************/ $(document).ready(function() { m_bxslider = $(".bxslider").bxSlider({ maxSlides: 1, moveSlides:1, slideWidth: 1200, speed: 1500, auto: true, autoHover:true, autoControls: true }); main_bxslider = $(".main_bxslider").bxSlider({ // mode: 'fade', // slideWidth: 1200, speed: 1200, auto: true, randomStart:true, pause: 5000, autoControls: true, onSlideBefore: function() { DspMainTitleReset(); }, onSlideAfter: function() { DspMainTitle(); } }); $('.mapArea').find(".gText").each(function() { $(this).css('display','none'); } ); }); /****************************************** / @ load ±âº» À̺¥Æ® *******************************************/ $(window).load(function(){ $('body,html').animate({scrollTop:0},900,'easeOutExpo'); ChkWindowSize(); if($('#mainWrap').hasClass('conEffect')) { conInit(); } /* main page ¿¡¼­ inquire hiden */ if( $('#mainWrap').hasClass('inquireHide') ) { $('a.btn_inquire').hide(); } MovePagePosition(); globalInit(); set_position_btn_top(); var msnry = new Masonry( '.masonry_container', { itemSelector: '.pin', isAnimated: false, isFitWidth: true }); mainScreen = $('.h_slider').textSlide({ autoView:false }); setTimeout(function(){ DspMainTitle(); $('.title_slider').show(); },300); }); /****************************************** / @ resize ±âº» À̺¥Æ® *******************************************/ $(window).resize(function(){ ChkWindowSize(); set_position_btn_top(); });//end resize /****************************************** / @ scroll ±âº» À̺¥Æ® *******************************************/ $(window).scroll(function(){ set_position_btn_top(); }) /******************************************* function ********************************************/ function ChkWindowSize() { windowWidth = $(window).width(); // PR people Action ¼³Á¤ $('.m_people').find('.bg').css('opacity', 1).fadeOut(0); $('.m_people div.info').css('display','none'); $('.m_people').bind('mouseenter mouseleave',function(e){ if(e.type=='mouseenter'){ $(this).find('.bg').fadeIn(300); $(this).find('div.info').fadeIn(300); }else{ $(this).find('.bg').fadeOut(300); $(this).find('div.info').fadeOut(500); } }); if( windowWidth > 768 ) { // PC if(!$('#mainWrap').hasClass('conEffect')) { // $('#mainWrap').addClass('conEffect'); } if( m_bxslider.length != 0 ) { m_bxslider.reloadSlider ({ auto: true, maxSlides: 1, moveSlides:1, slideWidth: 1200, autoHover:true, }); } $(".branch_name").text("HEAD OFFICE / MF"); // ODM, R&D $('.m_visual').find('.bg').css('opacity', 0).fadeOut(0); $('.m_visual span.info').css('display','none'); $('.m_visual div.info').css('display','none'); $('.m_visual').bind('mouseenter mouseleave',function(e){ if(e.type=='mouseenter'){ $(this).find('span.info').fadeIn(300); $(this).find('.bg').css('opacity', 1).fadeIn(300); $(this).find('div.desc').fadeIn(300); $(this).find('div.info').fadeIn(300); }else{ $(this).find('span.info').fadeOut(300); $(this).find('.bg').fadeOut(300); $(this).find('div.desc').fadeOut(500); $(this).find('div.info').fadeOut(500); } }); // Office $('.branch_office' ).find('.bg').css('height',$('.branch_img').css("height")); // bg height $('.branch_office' ).bind('mouseenter mouseleave',function(e){ if(e.type=='mouseenter'){ $(this).find('p').css('opacity', 1).fadeIn(500); }else{ $(this).find('p').fadeOut(300); } }); $('.cmp_branch dl').find('span').fadeOut(0); $('.cmp_branch dl').bind('mouseenter mouseleave',function(e){ if(e.type=='mouseenter'){ $(this).find('span').fadeIn(500); }else{ $(this).find('span').fadeOut(300); } }); $('.mapArea').bind('mouseenter mouseleave',function(e){ if(e.type=='mouseenter'){ TweenMax.to($(this).find('div'),1.1,{scale:1.1}); }else{ TweenMax.to($(this).find('div'),1,{scale:1}); } }); } else { // Mobile Only office_action_mobile(); set_position_mobile_odm_porc_em(); } if( windowWidth > 480 && windowWidth <= 768 ) { if($('#mainWrap').hasClass('conEffect')) { // $('#mainWrap').removeClass('conEffect'); } if( m_bxslider.length != 0 ) { m_bxslider.reloadSlider ({ auto: true, // controls:false, // pager:false, maxSlides: 1, moveSlides:1, slideWidth: windowWidth, autoHover:true, }); } $(".branch_name").text("HEAD OFFICE"); } if( windowWidth <= 480 ) { if($('#mainWrap').hasClass('conEffect')) { // $('#mainWrap').removeClass('conEffect'); } if( m_bxslider.length != 0 ) { m_bxslider.reloadSlider ({ auto: false, controls:false, // pager:false, maxSlides: 1, moveSlides:1, autoHover:true, }); } $(".branch_name").text("HEAD OFFICE"); } } // End ChkWindowSize $(function(){ setTimeout( resize , 500 ); function resize(){ if($(window).width() < 800) { $(".newwin").width( $(window).width() - 20 ).css({'left' : '10px' , 'top' : '10px'}); } } $(window).resize(function(){ resize(); }); }); /*------------------------------------*/ /* Mobile Side Menu ¼³Á¤ */ /*------------------------------------*/ function loaded() { /* sub_menu iscroll ±â´É ¼³Á¤ */ $(".mobile_menu").css('left','0'); $(".submenu").css('display','block'); myScroll = new iScroll('gnb_scroll', { useTransition: true, hScrollbar: false, vScrollbar: false, mouseWheel:false, bounce:false, onBeforeScrollStart: function (e) { var target = e.target; while (target.nodeType != 1) target = target.parentNode; if (target.tagName != 'SELECT' && target.tagName != 'INPUT' && target.tagName != 'TEXTAREA') e.preventDefault(); } }); $(".mobile_menu").css('left','-250px'); } document.addEventListener('DOMContentLoaded', function () { setTimeout(loaded, 200); }, false); // End Mobile Side Menu ¼³Á¤ function MovePagePosition() { /* È­¸é À§Ä¡ À̵¿ */ list_target = getParameter("num"); if(list_target != ""){ var _n = Number(list_target); var _y = $('#mainWrap').find('> section:eq('+(_n)+')').offset().top; setTimeout(function(){ $('html,body').stop(true).animate({scrollTop:_y},300); },300); } /* PR Page À§Ä¡À̵¿ */ list_target = getParameter("PR"); if(list_target != ""){ var _n = Number(list_target); var _y = $('.gridder').find('> li:eq('+(_n)+')').offset().top; /* setTimeout(function(){ $('html,body').stop(true).animate({scrollTop:_y},300); },300); */ $('.gridder').find('> li:eq('+(_n)+')').trigger("click"); } /* Company Office Page À§Ä¡À̵¿ */ list_target = getParameter("CM"); if(list_target != ""){ var _n = Number(list_target); var _y = $('.cmp_branch').find('> dl:eq('+(_n)+')').offset().top - ($(window).height()/2) + ( $('.cmp_branch').find('> dl:eq('+(_n)+')').height() / 2 ); console.log( $('.cmp_branch').find('> dl:eq('+(_n)+')').offset().top ); console.log( $('.cmp_branch').find('> dl:eq('+(_n)+')').height() ); console.log( _y ); setTimeout(function(){ $('html,body').stop(true).animate({scrollTop:_y},300); },300); } } /************************************** * common event ***************************************/ $('.r_visual').bind('mouseenter mouseleave',function(e){ if(e.type=='mouseenter'){ TweenMax.to($(this).find('img'),1.2,{scale:1.1}); }else{ TweenMax.to($(this).find('img'),1,{scale:1}); } }); function DspMainTitle() { mainScreen.nextSlide(); } function DspMainTitleReset() { mainScreen.ResetSlide(); } function globalInit() { var cTarget = $('.mapArea'); var total = 6; var cCurIndex = -1; // total = cTarget.find('.gPoint').length; // console.log("total : " + total); Action = { _ViewOn:function( cIndex ) { gTxtlength = cTarget.find('.group'+cIndex).length; for (i = 0; i < gTxtlength; i++) { cTarget.find( '.gPoint.group'+cIndex).eq(i).delay( (i+1)*200 ).fadeOut(100); cTarget.find( '.gText.group'+cIndex).eq(i).delay( (i+1)*200 ).fadeOut(100); } //cTarget.find('.gPoint.group'+cIndex).each( function(){ $(this).fadeOut(0); }); for (i = 0; i < gTxtlength; i++) { cTarget.find('.gPoint.group'+cIndex).eq(i).delay( (i+1)*300 ).fadeIn(750); cTarget.find('.gText.group'+cIndex).eq(i).delay( (i+1)*300 ).fadeIn(750); } } } setInterval(function(){ cTarget.find(".gText").each(function() { $(this).fadeOut(100); } ); cCurIndex++; if( cCurIndex >= total ) cCurIndex = 0; Action._ViewOn(cCurIndex); },2500); //1500 } function office_action_mobile() { var cTarget = $('.branch'); var total = 0; var curindex = -1; var dir = 0; total = cTarget.find('.r_visual').length; Action1 = { _ViewTween:function( cIndex , cflag ) { curVisual = cTarget.find('.r_visual').eq(cIndex); if( cflag ) TweenMax.to(curVisual.find('img'),1.3,{scale:1.1}); else TweenMax.to(curVisual.find('img'),1,{scale:1}); } } setInterval(function(){ if( dir == 0 ) curindex++; curindex1 = curindex+1; if( curindex >= total ) curindex = 0; if( curindex1 >= total ) curindex1 = 0; if( dir == 0 ) dir = 1; else dir = 0; Action1._ViewTween(curindex , dir); Action1._ViewTween(curindex1 , dir); },2500); } $(".btn_top").click(function(){ $('body,html').animate({scrollTop:0},900,'easeOutExpo'); return false; }); // top button hide/show function function set_position_btn_top() { CurPos = $(window).scrollTop(); CurWidth = $(window).width(); if( CurPos < 5 ) { $('.btn_top').css('display','none'); } else { $('.btn_top').css('display','block'); } if( CurWidth > 1200 ) { _y = $('#mainWrap').offset().left; console.log(_y); $('.btn_top').css("right", (_y + 20) ); } else { $('.btn_top').css("right",20); } } // set position odm_porc em function set_position_mobile_odm_porc_em() { var odm_porc_li_width = $('#b1_mobile').find('em').eq(1).parent().css('width'); $('#b1_mobile').find('em').css('left',odm_porc_li_width ); $('#b1_mobile').find('em').css('left',"-=27"); $('#b1_mobile').find('em').eq(3).css('left',-27); $('#b1_mobile').find('em').eq(4).css('left',-27); }