/****************************************/ /* Name: KOSEP /* PART: Javascript /* Version: 1.0 /* Author: 박현아 /****************************************/ $(function(){ /* Part : DOMESTIC BUSINESS */ var $listPreview = $('.list_preview'), $listPreviewLi = $listPreview.find('>li'), $listPreviewA = $listPreviewLi.find('>a'); $listPreviewA.on('mouseenter focusin', function(){ $listPreviewLi.removeClass('on'); $(this).parent().addClass('on'); }); //end mouseenter $(this).on('focusin', '.btn_go', function(event){ $('.trick_focus').remove(); $listPreviewLi.removeClass('on'); $(this).parent().parent().parent().addClass('on'); }); //end focusin /* Part : LAYER POPUP */ var $mapArea = $('.btn_pop area'); var $mapAreaThis; var UserAgent = navigator.userAgent; var $overlayer ='
'; var $wrapOverseas = $('.warp_overseas'), warpOffset = $('.warp_overseas').offset(); $mapArea.on('click', function(event){ //prevent default action (hyperlink) event.preventDefault ? event.preventDefault() : event.returnValue = false; $mapAreaThis = event.target; $mapAreaThis.focus(); var index = $(this).index()+1; var href = $(this).attr("href") + " #popWrap0"+index; $('#wrap').append($overlayer); $('.layerCont').load(href, function(){ $(this).css({ 'position': 'absolute', 'left': warpOffset.left + 20, 'top': warpOffset.top + 20, 'z-index': 2 }); //end css $(this).find('a:eq(0)').focus(); }); //end load if(UserAgent.match('MSIE 8.0')!=null){ var $focus = 'focus'; $('.trick_focus').remove(); $('.warp_overseas').append($focus); $('.trick_focus a').attr('href', href); var _coords = []; _coords = $(this).attr('coords').split(','); var _width = _coords[2] - _coords[0], _height = _coords[3] - _coords[1]; $('.trick_focus').css({ 'position': 'absolute', 'left': _coords[0]+'px', 'top': _coords[1]+'px', 'display': 'block', 'width': _width, 'height': _height, 'z-index': 1, 'border': '#000 1px dotted' }); //end css } //end if MSIE 8.0 });//end click $mapArea.on('focusin', function(){ var index = $(this).index()+1; var href = $(this).attr("href") + " #popWrap0"+index; if(UserAgent.match('MSIE 8.0')!=null){ var $focus = 'focus'; $('.trick_focus').remove(); $('.warp_overseas').append($focus); $('.trick_focus a').attr('href', href); var _coords = []; _coords = $(this).attr('coords').split(','); var _width = _coords[2] - _coords[0], _height = _coords[3] - _coords[1]; $('.trick_focus').css({ 'position': 'absolute', 'left': _coords[0]+'px', 'top': _coords[1]+'px', 'display': 'block', 'width': _width, 'height': _height, 'z-index': 1, 'border': '#000 1px dotted' }); //end css } //end if MSIE 8.0 });//end $(this).on('click', '.pop_wrap .btn_close', function(){ $('.layerCont').remove(); $mapAreaThis.focus(); return false; });//end click $(this).on('keydown', '.pop_wrap .btn_close', function(event){ if(event.keyCode == 9){ return false; } //end if }); $(this).on('focusin', '.wrap_cont .col3 a', function(){ $('.trick_focus').remove(); }); }); //end function