$(function () { $("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) } }); 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"); }) 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 ; 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 ; 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 ) { } browserSet () ; }) 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 () { $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' ) ; } } $(".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 castCtrl = castHandler ( $castCategory ) ; 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) ) ; } }) ; that.closeBtn.bind({ click : function (e) { e.preventDefault() ; that.btnClick( e , $(this) ) ; } }) ; } var slideSet = function (param){ var $element = param, slideList = new Array; $element.find(" > div").each(function(idx){ slideList[idx] = $(this); }); var that = { slideList:slideList, slide:function(css, duration, callback){ $element.stop().animate(css, duration, callback); }, dot:function(element, className, handler){ var $btnTable = element; $btnTable.bind("click",handler); return $btnTable; } } return that; } var chkThumBool = true ; var mainSlide = function(){ var $slide = $(".imgBox"), slide = slideSet($slide), index = 0, animated = true, index2 = 0, width = $(window).width(), slideList = slide.slideList; var $dotList = slide.dot($(".pageControl a"), 'thum', function(e){ clearInterval(moveAuto); e.preventDefault(); if($(this).hasClass('thum')){ if ( chkThumBool == false ) { clearInterval(moveAuto); chkThumBool = true ; } if(animated == true && $(this).index() != index){ animated = false; index = $(this).index(); $dotList.filter('.stop').addClass( 'active' ) ; $dotList.eq(index).addClass("active").siblings().removeClass("active"); $('.pageControl a.stop').addClass('active') ; slide.slide({'left':-1120}, 1000, function(){ $slide.find("div").eq(0).appendTo($slide); $(this).css({"left":0}); animated = true; }); } } else if($(this).hasClass("play")){ clearInterval(moveAuto); $(this).addClass( 'active' ) ; $dotList.filter('.stop').removeClass( 'active' ) ; if ( chkThumBool == true ) { moveAuto = setInterval(function(){slideMove()}, 5000); chkThumBool = false ; } } else if($(this).hasClass("stop")){ $('.pageControl a.play').removeClass('active') ; $(this).addClass( 'active' ) ; clearInterval(moveAuto); } }); var slideMove = function(){ animated = false; index++; if(index >= $dotList.length-2){ index = 0; } $dotList.eq(index).addClass("active").siblings().removeClass("active"); $dotList.filter('.play').addClass( 'active' ) ; slide.slide({'left':-1120}, 1000, function(){ $slide.find("div").eq(0).appendTo($slide); $(this).css({"left":0}); animated = true; }); } moveAuto = setInterval(function(){slideMove()}, 5000); } $(function () { var $openPopBtn = $('a.openPopBtn') ; $openPopBtn.bind( 'click' , openPopBtnClickHandler ) ; function openPopBtnClickHandler (e) { e.preventDefault() ; if ( $('body div.popArea') ) $('body div.popArea').remove(); var $popArea = $('').append('') ; var urlName = '/html/pop/' + $(this).attr('href').replace( '#' , '' ) + '.html'; $popArea.find(' > div.box').load( urlName , function () { var $motherBox = $(this) ; var $contBox = $motherBox.find('div.pop_wrap') ; var $pop_close = $contBox.find('a.pop_close') ; var winH = $(window).height() ; var docH = $(document).height() ; var contH = $contBox.height() ; var scrollT = $(window).scrollTop() ; var chkH ; $contBox.css({ 'top' : -(contH + 200) }) ; $(this).css({ 'width' : $contBox.width() }) ; $popArea.stop().animate({ 'height' : docH + 'px' }) ; $popArea.css('visibility','visible'); ( contH < winH ) ? chkH = scrollT + ( ( winH - contH ) / 2 ) : chkH = scrollT + 20 ; $contBox.stop().animate({ 'top' : chkH + 'px' }, function(){ $contBox.attr("tabindex", -1).focus(); }) ; $pop_close.click(function (e) { e.preventDefault() ; $contBox.stop().animate({ 'top' : -(contH + 200) }) ; $popArea.stop().animate({ 'height' : '0px' }) ; $('.currentTab').focus(); $popArea.css('visibility','hidden'); }) ; $contBox.find('.pop_close').bind("keydown",function(e){ if ( e.keyCode == 9 ) { if ( e.shiftKey ) { } else { e.preventDefault(); $popArea.find('popArea div.pop_wrap').attr("tabindex", -1).focus(); } } }) ; $contBox.find('a').eq(0).bind("keydown",function(e){ if ( e.keyCode == 9 ) { if ( e.shiftKey ) { e.preventDefault(); } } }) ; } ) $(this).addClass('currentTab').attr('href'); $('body').append( $popArea ); } })