$(function(){ /* Part : FOOTER Author : */ var $familySite = $('.wrap_site strong a'), $familySiteUl = $('.wrap_site>.wrap_family'), $familySiteUlLi = $familySiteUl.find('>ul>li') $familySiteLi = $familySiteUl.find('li'), $familySiteA = $familySiteLi.find('a'); var familySiteUlH = $familySiteUl.outerHeight()-1; //$familySiteUl.css('top', -familySiteUlH); $familySiteUl.css('top', '-113px'); $familySiteUl.hide(); $familySite.on('click', function(event){ event.preventDefault ? event.preventDefault() : event.returnValue = false; if($(this).is('.on')){ $familySiteUl.hide(); $(this).removeClass('on'); }else{ $familySiteUl.show(); $(this).addClass('on'); } });//end familySite click $familySiteA.on('click', function(event){ event.preventDefault ? event.preventDefault() : event.returnValue = false; var listText = $(this).html(); var listSrc = $(this).attr('href'); $familySiteUl.hide(); $familySite.removeClass('on').focus(); $familySite.text(listText); $('.btn_go').attr('href', listSrc); }); $('.btn_go, .footer_util li a').on('focusin', function(){ $familySiteUl.hide(); }); var except = $('.wrap_site'); $(document).on('click', function(event){ if(!$(event.target).parents().is(except)){ /*패밀리 사이트*/ $familySiteUl.hide(); $familySite.removeClass('on'); } }); });