$(function () { /*$("a[href^='#']").click(function(evt){ var anchortarget = $(this).attr("href"); $(anchortarget).attr("tabindex", -1).focus(); }); if (window.location.hash) { $(window.location.hash).attr("tabindex", -1).focus(); }*/ // Fxes anchor focus in Chrome/Safari/IE by setting the tabindex of the // target container to -1 on page load $("a[href^='#']").click(function (evt) { if (!$(this).closest('p').hasClass('pageControl')) { var anchortarget = $(this).attr("href"); $(anchortarget).attr("tabindex", -1).focus(); setTimeout(function () { $(anchortarget).removeAttr("tabindex"); }, 10) } }); //2013-12-10 ¼öÁ¤ if (window.location.hash) { $(window.location.hash).attr("tabindex", -1).focus(); } $("#skip a").bind("focus",function(){ $("#skip a").removeClass("on"); $(this).addClass("on"); }) $("#skip a").bind("blur",function(){ $("#skip a").removeClass("on"); })//2013-09-03 ¼öÁ¤ var $mainBox = $('div.mainBox') ; // ¸ÞÀÎ ¹Ú½º var $middleCont = $mainBox.find('> div.middleCont') ; // ¸ÞÀÎ ¹ÌµéÄÁÅÙÃ÷ ¹Ú½º var $footBox = $mainBox.find('> div.footBox') ; // ¸ÞÀΠǪÅÍÄÁÅÙÃ÷ ¹Ú½º var $slideBox = $middleCont.find('div.slideBox') ; // ¸ÞÀÎ À̹ÌÁö½½¶óÀÌµå ¹Ú½º var $browser = $(window) ; // ÇöÀç ºê¶ó¿ìÀú winHalfWidth = ($browser.width() - $mainBox.width()) / 2 ; // ºê¶óºÎ¾î ¿©¹é ±æÀÌÀÇ Áß°£ °ª // var $naviBox = $('ul.naviBox') ; // var $naviWrapBox = $('
').append('') ; var $naviBox ; var $naviWrapBox ; var $movingBox ; /* [ ÃÖÃÊ ºê¶ó¿ìÀú ¹é±×¶ó¿îµå ¼Â¾÷ ] */ function browserSet () { if ( $mainBox.find('div.bgSet').length == 0 ) { $naviBox = $('ul.naviBox') ; $naviWrapBox = $('').append('') ; $naviWrapBox.remove() ; $naviBox.wrap( $naviWrapBox ) ; $naviWrapBox = $('div.naviWrap') ; $movingBox = $('div.movingBox') ; $movingBox.append('') ; var $mainBg = $('') ; $mainBox.prepend( $mainBg.clone().addClass('left').append('') , $mainBg.clone().addClass('right').append('') ) ; $middleCont.prepend( $mainBg.clone().addClass('left') ) ; $footBox.prepend( $mainBg.clone().addClass('left') , $mainBg.clone().addClass('right') ) ; $slideBox.find('div.imgBox div').each(function (idx) { $(this).addClass( 'idx' + idx ) ; }) browserResize () ; } else { browserResize () ; } } browserSet () ; $naviBox.bind( 'mouseenter' , naviBoxOverHandler ) ; $movingBox.bind( 'mouseleave' , naviBoxOutHandler ) ; $naviBox.find('> li').bind( 'mouseenter' , naviBoxListOverHandler ) ; // [ ¿ÞÂÊ ¸Þ´º ] // var $castCategory = $('ul.castCategory') ; var $castDetail = $castCategory.find('div.detail') ; var $castCategoryClose = $castCategory.find('a.close') ; var moveWidth = 640 ; // $castDetail.wrap('') ; /* [ ºê¶ó¿ìÀú ÁÂ¿ì ¹è°æ ¸®»çÀÌÁî ¼Â¾÷ ] */ function browserResize () { $mainBox.find('div.bgSet').css({ 'width' : winHalfWidth + 'px' }) ; $mainBox.find('div.bgSet.left').css({ 'left' : -winHalfWidth + 'px' }) ; $mainBox.find('div.bgSet.right').css({ 'right' : -winHalfWidth + 'px' }) ; if ( $(window).width() > 960 ) { $('body, html').css({ 'overflow-x' : 'hidden' }) ; $naviWrapBox.css({ 'width' : $browser.width() , 'margin-left' : -(($browser.width() - 960) / 2) + 'px' }) ; $(".main_wrap").css({ 'overflow' : 'hidden' ,'width' : $browser.width()}) ; } else { $('body, html').removeAttr("style") ; // $naviWrapBox.css({ 'width' : $browser.width() , 'margin-left' : '0px' }) ; $naviWrapBox.css({ 'width' : '960px' , 'margin-left' : '0px' }) ; $(".main_wrap").css({ 'overflow' : 'hidden' ,'width' : '960px'}) ; } } /* [ ºê¶ó¿ìÀú ¸®»çÀÌÁî Á¦¾î ] */ $browser.resize(function () { winHalfWidth = ($browser.width() - $mainBox.width()) / 2 ; if ( $browser.width() > 960 ) { // slideBoxWidth = $browser.width() - winHalfWidth - $castCategory.find('div.intro').width() ; } // trace( winHalfWidth ) ; browserSet () ; }) /* [ top navi °í°´¼¾ÅÍ Á¦¾î ] */ var $customeBtn = $mainBox.find('.quickMenu ul.type2 li.menu1 > a') ; var $customeList = $customeBtn.find('+ div.list') ; $customeList.slideUp() ; $customeBtn.bind( 'click' , customeBtnClickHandler ) ; function customeBtnClickHandler (e) { var $arr = $('') ; $customeList.closest('li').append( $arr ) ; $customeList.css({ 'visibility' : 'visible' }) ; $customeList.slideDown( 250 ) ; } $customeList.bind( 'mouseleave' , customeListOutHandler ) ; function customeListOutHandler (e) { $customeList.slideUp( 250 , function () { $customeList.css({ 'visibility' : 'hidden' }) ; $customeList.closest('li').find('p.arr').remove() ; }) ; } $customeList.find('a:last').bind( 'keydown' , customeListKeydownHandler ) ; function customeListKeydownHandler (e) { if ( e.keyCode == 9 && !e.shiftKey ) { customeListOutHandler () ; } } $customeBtn.bind( 'keydown' , customeBtnKeydownHandler ) ; function customeBtnKeydownHandler (e) { if ( e.keyCode == 9 && e.shiftKey && $customeList.css('visibility') == 'visible' ) { customeListOutHandler () ; } } // [ ³»ºñ°ÔÀÌ¼Ç ] // function naviBoxOverHandler () { $naviBox.find('ul').css({ 'visibility' : 'visible' }) ; $naviBox.stop().animate({ 'height' : '240px' } , 100 ) ; $movingBox.stop().animate({ 'height' : '240px' } , 100 , function () { $movingBox.addClass( 'chk' ) ; }) ; } function naviBoxOutHandler () { if ( $movingBox.hasClass( 'chk' ) ) { $naviBox.stop().animate({ 'height' : '88px' } , 100 ) ; $movingBox.stop().animate({ 'height' : '88px' } , 100 , function () { //$naviBox.find('ul').css({ 'visibility' : 'hidden' }) ; $movingBox.removeClass( 'chk' ) ; }) ; } $naviBox.find('> li > a').removeClass( 'active' ) ; } function naviBoxListOverHandler (e) { e.stopPropagation() ; $(this).closest('li').siblings().find('> a').removeClass( 'active' ) ; $(this).closest('li').find('> a').addClass( 'active' ) ; } $naviBox.find('> li').bind( 'focusin' , naviBoxFocusinHandler ) ; function naviBoxFocusinHandler (e) { if ( !$movingBox.hasClass( 'chk' ) ) { $movingBox.addClass( 'chk' ) ; naviBoxOverHandler () ; } } $naviBox.find('li:first a:first').bind( 'keydown' , naviBoxFirstKeydownHandler ) ; function naviBoxFirstKeydownHandler (e) { if ( e.keyCode == 9 && e.shiftKey ) { naviBoxOutHandler () ; } }//2013-09-03 script Ãß°¡ $naviBox.find('li:last').bind( 'keydown' , naviBoxLastKeydownHandler ) ; function naviBoxLastKeydownHandler (e) { if ( e.keyCode == 9 ) { naviBoxOutHandler () ; $movingBox.removeClass( 'chk' ) ; } } // °è¿È¸»ç SITE $(".familySite > a").bind( 'click ' , function(e){ e.preventDefault(); }) $(".familySite").on("mouseenter focusin", function(e){ e.preventDefault(); $(this).find(".list").stop(true,true).slideDown(200); }).mouseleave(function(){ $(this).find(".list").stop(true,true).slideUp(200); }); $('*:not(".familySite a")').focus(function(){ $(".familySite .list").stop(true,true).slideUp(200); }); // [ ¸ÞÀÎ ·¹ÇÁÆ® ¹Ú½º Á¦¾î ] var $castCategory = $middleCont.find('> ul.castCategory') ; // var castSetup = castObject ( $castCategory ) ; var castCtrl = castHandler ( $castCategory ) ; /* Main slide Controll*/ mainSlide(); $(".pageControl .play").addClass("active"); siteMapHandler ( $mainBox.find('.quickMenu ul.type2 li.menu2') ) ; }) function siteMapHandler ( obj ) { var that = siteMapObj ( obj ) ; that.$siteMap.css({ 'visibility' : 'hidden' }).slideUp(0 , function () { that.$siteMap.css({ 'visibility' :'visible' }) ; }) ; that.$target.bind( 'click' , function (e) { that.siteMapOpenHandler () ; }) ; that.$btnClose.bind( 'click' , function (e) { e.stopPropagation() ; that.siteMapCloseHandler () ; }) ; that.$windo.resize(function () { that.siteMapWidthResizeHandler ( $(this).width() ) ; }) } function siteMapObj ( target ) { var that = { $target : target , $siteMap : target.find('div.siteMap') , $btnClose : target.find('a.close') , $shadow : target.find('div.bgBox') , $windo : $(window) , speed : 350 , siteMapOpenHandler : function () { that.$siteMap.slideDown( that.speed ) ; } , siteMapCloseHandler : function () { that.$siteMap.slideUp( that.speed ) ; } , siteMapWidthResizeHandler : function ( _w ) { var halfW = (_w - 960) / 2 ; that.$siteMap.css({ 'width' : _w + 'px' , 'left' : -halfW + 'px' }) ; } } ; return that ; } function castObject ( target ) { var that = { openBtn : target.find('div.intro > a') , detailBox : target.find('div.detail') , closeBtn : target.find('div.detail').find('a.close') , oriWidth : parseInt(target.css('width')) , zidx : parseInt(target.find('div.detail').css('z-index')) , duration : 750 , easing : 'easeInOutSine' , slide : function ( idx , css , callback) { target.stop().animate( css , target.duration , that.easing ,callback) ; } , btnClick : function ( e , obj ) { e.preventDefault() ; var idx = obj.closest('li').index() ; if (obj.hasClass( 'active' )) { that.closeBtn.click(); }else{ that.openBtn.removeClass( 'active' ) ; if ( !obj.hasClass('close')) { obj.addClass( 'active' ) ; if ( parseInt(target.css('width')) > that.oriWidth ) { that.detailBox.eq(idx).fadeOut(0).fadeIn(that.duration) ; } else { that.slide( idx , { 'width' : '960px' } ) ; } that.detailBox.eq(idx).removeClass( 'v-h' ).css({ 'z-index' : that.zidx+1 }) ; that.detailBox.filter(':not(:eq(' + idx + '))').addClass( 'v-h' ).css({ 'z-index' : that.zidx }) ; } else { that.slide( idx , { 'width' : that.oriWidth + 'px' }, function(){ that.detailBox.addClass( 'v-h' ) ; }) ; } } } } ; return that ; } function castHandler ( target ) { var that = castObject ( target ) ; that.openBtn.bind({ click : function (e) { that.btnClick( e , $(this) ) ; // e.preventDefault() ; // idx = $(this).closest('li').index() ; // that.detailBox.eq(idx).removeClass( 'v-h' ).css({ 'z-index' :'118' }) ; // that.slide( idx , { 'width' : 960 } ) ; } }) ; that.closeBtn.bind({ click : function (e) { e.preventDefault() ; that.btnClick( e , $(this) ) ; } }) ; } //»ýȰÀ» ´õ¿í dz·á·Ó°í Æí¸®ÇÏ°Ô ´«¿¡ º¸ÀÌÁö ¾Ê´Â °÷¿¡ »ï¾çÀÌ ÇÔ²² Çϰí ÀÖ½À´Ï´Ù.
// About Samyang ÀÚ¼¼È÷ º¸±â //