(function ( $ ) { $.fn.queued = function () { var self = this; var func = arguments[0]; var args = [].slice.call( arguments, 1 ); return this.queue( function () { $.fn[func].apply( self, args ).dequeue(); }); } }( jQuery )); $( function () { var playing = false; var winW; var winH; var $sectionWrap = $( ".sectionWrap" ); var $section = $( ".section" ); var sectionActive = 0; var footHeight; // if($section.width() <= 720) { // $('body').addClass('mo') // }else if($section.width() > 720 && $section.width() <= 1100 ) { // // topBannInit() // $('body').removeClass('mo') // $('body').addClass('tablet'); // }else if($section.width() > 1100 ) { // // topBannInit() // $('body').removeClass('mo') // $('body').removeClass('tablet'); // }; resize( true ); init(); // gnb(); var resizeTiming; $( window ).resize( function () { resize(); }); function init() { var sectionMany = $section.length - 1; $( document ).mousewheel( function ( event, delta ) { if ( !$( 'body' ).is( '.mo' ) && !$( 'body' ).is( '.tablet' ) ) { if ( !playing && !$( "body" ).hasClass( "dim" ) ) { playing = true; if ( delta == -1 ) { if ( sectionActive < sectionMany ) { sectionActive = sectionActive + 1; } else { setTimeout( function () { playing = false; }, 100 ) return; } } if ( delta == 1 ) { if ( sectionActive == 0 ) { setTimeout( function () { playing = false; }, 100 ) return; } else { sectionActive = sectionActive - 1; } } $( ".btn_event_close" ).click(); sectionAnimating( sectionActive, 700 ); } } }); $( ".mainStep ul li a" ).click( function ( e ) { e.preventDefault(); var idx = $( this ).closest( "li" ).index(); sectionAnimating( idx, 700 ); var focusItem = setTimeout( function () { $( '.section' ).eq( idx ).focus() }, 750 ); }) $( ".scroll" ).click( function ( e ) { e.preventDefault(); if ( sectionActive < sectionMany ) { sectionAnimating( sectionActive + 1, 700 ); } }) $( ".btn_main_up" ).click( function ( e ) { e.preventDefault(); if ( sectionActive != 0 ) { sectionAnimating( sectionActive - 1, 700 ); } }) $( ".btn_contentTop" ).click( function ( e ) { e.preventDefault(); sectionAnimating( 0, 700 ); }) $( ".btnAllmenu" ).click( function ( e ) { if ( !$( 'body' ).is( '.mo' ) ) { sectionAnimating( 0, 700 ); } }) sectionAnimating( 0, 0 ); } function sectionAnimating( active, speed ) { sectionActive = active; // $(".section").eq(active).focusin(function(){ // sectionActive = $(this).index(); // }) if ( sectionActive != 2 ) { $( ".mainWrap" ).attr( "class", "mainWrap section" + (sectionActive) ); } $( ".sectionWrap" ).attr( "class", "sectionWrap section" + (sectionActive) ); $( ".mainStep a" ).blur(); $section.css( "z-index", 9 ); $section.eq( active ).css( "z-index", 10 ).addClass( "active" ); var top = -winH * active; if ( sectionActive < 6 ) { } else { top = -((winH * (active - 1)) + footHeight); } $( ".sectionWrap" ).stop().animate( { top: top }, { duration: speed, easing: "easeInOutCubic", complete: function () { playing = false; $( ".section" ).filter( function ( index ) { return index != active; }).removeClass( "active" ); if ( sectionActive == 2 ) { $( ".mainWrap" ).attr( "class", "mainWrap section" + (sectionActive) ); } if ( !$( "html" ).hasClass( "htmlInit" ) ) { $( "html" ).addClass( "htmlInit" ); resize( true ); } else { resize(); } // if (sectionActive < 4) { $( ".mainStep li" ).removeClass( "on" ).eq( active ).addClass( "on" ); // } if ( !$( ".section" ).eq( active ).hasClass( "motion" ) ) { $( ".section" ).eq( active ).addClass( 'on' ) $( ".section" ).eq( active ).find( '.appear-animation' ).each( function ( index, el ) { $( el ).delay( index * 250 ).queue( function ( next ) { $( this ).addClass( "fadeInUp" ); next(); }); }); } } }); if ( sectionActive == 0 ) { if ( !$( "body" ).is( '.tablet' ) && !$( "body" ).is( '.mo' ) ) { $( ".topMenuWrap" ).stop().slideDown( { duration: 500, easing: "easeInOutCubic" }); $( ".mainStep" ).show().stop().animate( { right: "50px", opacity: 1 }, { duration: 1000, easing: "easeInOutCubic" }); $( '.gnbWrapBg' ).removeClass( 'init' ); $( '#header' ).removeClass( 'minimize' ) } } else { if ( !$( "body" ).is( '.tablet' ) && !$( "body" ).is( '.mo' ) ) { $( ".topMenuWrap" ).stop().slideUp( { duration: 500, easing: "easeInOutCubic" }); $( ".mainStep" ).show().stop().animate( { right: "50px", opacity: 1 }, { duration: 1000, easing: "easeInOutCubic" }); $( '.gnbWrapBg' ).addClass( 'init' ); if ( !$( 'body' ).hasClass( 'tablet' ) ) { $( '#header' ).addClass( 'minimize' ) } } } if ( sectionActive == 5 || sectionActive == 6) { $("#logo").addClass('bgWhite') $("#gnb").addClass('bgWhite') } else { $("#logo").removeClass('bgWhite') $("#gnb").removeClass('bgWhite') } // if ( sectionActive == 1 || sectionActive == 2 || sectionActive == 3 || sectionActive == 4 || sectionActive == 5 || sectionActive == 6 ) { $( ".mainStep" ).addClass( 'type02' ) // } else { // $( ".mainStep" ).removeClass( 'type02' ) // } /*if (sectionActive == 6 ) { $(".mainStep ul").stop().animate({marginTop:26}, 300) } else { $(".mainStep ul").stop().animate({marginTop:0}, 300) }*/ } // $(".section").on({ // focusin: function (e) { // e.preventDefault(); // var idx = $(this).index(); // sectionAnimating(idx, 0); // } // }) //리사�즈 function resize( first ) { if ( !$( 'body' ).is( '.mo' ) && !$( 'body' ).is( '.tablet' ) ) { winH = $( window ).height(); if ( winH <= 800 ) { winH = 800; } // $('.section.section02 .sectionCon').css({height:winH}) // $('.section.section02 .sectionCon .sec02Cont img').css({height:winH, width: $(window).width() / 3}) if ( sectionActive != 0 ) { $( ".header" ).stop().animate( { top: -108 }, { duration: 500, easing: "easeInOutCubic" }); // $('.mainStep').stop().animate({top:0},300) $( '.gnbWrapBg' ).addClass( 'init' ); // $(".mainStep").addClass('step01'); // $('.mainStep').stop().animate({top:0, height:"100%"},400, "easeInOutCubic") } else { $( ".header" ).stop().animate( { top: 0 }, { duration: 500, easing: "easeInOutCubic" }); $( '.gnbWrapBg' ).removeClass( 'init' ); // $('.mainStep').stop().animate({top:90, height:winH - 90},500, "easeInOutCubic") } var many = $section.length; var top = -winH * sectionActive; footHeight = $("#footer").get(0).clientHeight; if ( sectionActive == 6 ) { top = -((winH * (sectionActive - 1)) + footHeight); // $(".mainStep li").removeClass("on"); } $( ".sectionWrap" ).css( { top: top }); if ( $( ".topEventWrap" ).css( "display" ) == "block" ) { $( ".mainWrap" ).css( { height: $( window ).height() - 127, "top": 127 }); $( ".section" ).css( { height: $( window ).height() - 127 }); } else { $( ".section, .mainWrap" ).css( { height: winH }); } } else { // $('.section.section02 .sectionCon').css({height:"auto"}) // $('.section.section02 .sectionCon .sec02Cont img').css({height:"auto", width: "100%"}) } // ¡ ó } }) $( function () { var height = jQuery( '.base-height' ).height(); function heightInit() { height = jQuery( '.base-height' ).height(); if ( height < 800 ) { } else { jQuery( '.mainVisual' ).height( height ); } } heightInit(); jQuery( window ).resize( function () { heightInit(); }); /*$(window).bind('resize', function() { var $winWidth = $(this).width(); if($winWidth > 1165) { $("#header").removeAttr('style'); } });*/ }); $( function () { var playing = false; var winW; var winH; var $sectionWrap = $( ".sectionWrap" ); var $section = $( ".section" ); var sectionActive = 0; var footHeight; if ( $section.width() <= 760 ) { $( 'body' ).addClass( 'mo' ) } else if ( $section.width() > 760 && $section.width() <= 1163 ) { $( 'body' ).removeClass( 'mo' ) $( 'body' ).addClass( 'tablet' ); } else if ( $section.width() > 1163 ) { $( 'body' ).removeClass( 'mo' ) $( 'body' ).removeClass( 'tablet' ); } ; //초 �팅 // resize(true); // init(); // gnb(); //�도�� 리사�즈 // var resizeTiming; $( window ).resize( function () { if ( $section.width() <= 760 ) { $( 'body' ).addClass( 'mo' ) $( 'body' ).removeClass( 'tablet' ); } else if ( $section.width() > 760 && $section.width() <= 1163 ) { $( 'body' ).removeClass( 'mo' ) $( 'body' ).addClass( 'tablet' ); $( '#header' ).css( { top: '' }) } else if ( $section.width() > 1163 ) { $( 'body' ).removeClass( 'mo' ) $( 'body' ).removeClass( 'tablet' ); } ; //clearTimeout(resizeTiming); //resizeTiming = setTimeout(function () { // resize(); //}, 10); // resize(); }); var fixMode; var tipBarFix; var chkFix; var doc = $( document ); var win = $( window ); var top; var lastId, stickyNav = $( ".mainStep" ), stickyNavHeight = stickyNav.outerHeight() + 1, menuItems = stickyNav.find( "a" ), scrollItems = menuItems.map( function () { var item = $( $( this ).attr( "href" ) ); if ( item.length ) { return item; } }); var checkFloating = function () { var fromTop = getScrollOffsets().top + stickyNavHeight; var cur = scrollItems.map( function () { if ( $( this ).offset().top < fromTop - ($( window ).outerHeight() / 3) ) return this; }); cur = cur[cur.length - 1]; var id = cur && cur.length ? cur[0].id : ""; if ( lastId !== id ) { lastId = id; menuItems // .parent().removeClass("on") .end().filter( "[href=#" + id + "]" ).parent().addClass( "on" ); } }; stickyNav.find( 'li' ).eq( 0 ).addClass( 'on' ) var getScrollOffsets = function () { return { 'left': window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft, 'top': window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop }; }; var getWindowSize = function () { var w = (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth || 1003) - 2, h = (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 650) - 2; return { "width": w, "height": h }; }; function targetMove( target, gutter ) { $( 'html, body' ).animate( { scrollTop: $( target ).offset().top - gutter }, 500, function () { }); } win.scroll( checkFloating ); checkFloating(); $( ".mainStep ul li a" ).click( function ( e ) { e.preventDefault(); $( ".mainStep ul li" ).removeClass( 'on' ); $( this ).parent().addClass( 'on' ); var target = $( this ).attr( 'href' ); targetMove( target, 0 ); }) function swing() { $( ".scroll" ).animate( { "bottom": "25px" }, 800 ).animate( { "bottom": "50px" }, 800, swing ); } swing(); })