$(function(){ $('#gnb > li').click(function(){ if($('.sub-wrap').css('display')=='block'){ $('.sub-wrap').slideup(); $('.btn-subclose').hide(); $('#gnb>li>ul').slideup(); }else{ $('.sub-wrap').slidedown(); $('.btn-subclose').show(); $('#gnb>li>ul').slidedown(); } return false; }); $(':not(.header a)').focus(function(){ $('.sub-wrap').slideup(); $('.btn-subclose').hide(); $('#gnb>li>ul').slideup(); }); $('.btn-subclose').click(function(){ $('.sub-wrap').slideup(); $('.btn-subclose').hide(); $('#gnb>li>ul').slideup(); }); $("#thumbs a").click( function(){ var largepath = $(this).attr("href"); $("#largeimg img").attr({ src: largepath }); } ); $("#thumbs a").click(function(){return false}); $("#tabchg2 li").click(function () { if($('#tabchg2 li').hasclass('on')){ $("#tabchg2 li.on").removeclass("on"); } $(this).addclass("on"); $(".tabcont").hide(); var cont_show = $(this).find('a').attr("class"); $("#"+cont_show).show(); return false; }); /* qna */ qna() /*tab change + auto rolling*/ //tabchg() subslide(); selectmotion(); }); function qna(){ var $item = $(".qna-list").find("li"), $itemevent = $item.find("strong").find("a"); $itemevent.on("click.qna",function(event){ event.preventdefault(); var idx = $itemevent.index(this); $item.each(function(event){ if($item.eq(event).hasclass("selected")) $item.eq(event).removeclass("selected"); }); $item.eq(idx).addclass("selected"); }); }; function subslide(){ $('.biz-visual .tab-cont').eq(0).show(); $('.biz-visual .thum').eq(0).find('a').addclass('on'); $('.biz-visual .thum').click(function(){ $('.biz-visual .tab-cont').hide(); $('.biz-visual .thum').find('a').removeclass('on'); $(this).find('a').addclass('on'); $(this).next().show(); return false; }); } /* layerpop */ function layerpop(wrap, close){ //ex : layerpop("#greenskill-allconts",".layer-close") var $event = $(wrap).find("ul").children("li").children("a"), $eventclose = $(close), //$bg = $("body"), $href; $event.click(function(event){ event.preventdefault(); //$bg.append("
"); $(this).after("
"); $href = $(this).attr("href"); $($href)[0].style.display = "block"; }) $eventclose.click(function(event){ event.preventdefault(); $(".layer-bg").detach(); $($href)[0].style.display = "none"; $(this).parent().prev().focus(); }); }; function selectmotion(){ $('.select2 .myvalue').click(function(){ if($(this).next().css('display')=='block'){ $(this).next().slideup(); $(this).parent().removeclass('open'); }else{ $(this).next().slidedown(); $(this).parent().addclass('open'); } return false; }); $(':not(.select2 a)').focus(function(){ $('.select2 .ilist').slideup(); $('.select2').removeclass('open'); }); $('.select2').mouseleave(function(){ $('.select2 .ilist').slideup(); $('.select2').removeclass('open'); }); }