function containerH() { var headerH1 = $("#header").outerHeight(); var headerH2 = $("#header").outerHeight() + $(".slidewrap").outerHeight(); if ($(".slidewrap").is(":visible")){ $(".container").css("margin-top",headerH2); } else { $(".container").css("margin-top",headerH1); } } /* function allMenuListH(){ tid = $(window).height() - $('.allmenu_header').height(); $('.allmenu_list').css("height",tid); } */ // Main Slide Banner function mainslider(){ $(".event").owlCarousel({ items : 1, loop:true, // 1°³ÀÎ °æ¿ì : flase (¹Ýº¹ ·Ñ¸µ ¾øÀ½) // 2°³ ÀÌ»óÀÎ °æ¿ì : true (¹Ýº¹ ·Ñ¸µ Àû¿ë) center:true, dots:true, autoplay:true, animateOut:'fadeOut', animateIn:'fadeIn' }); } // Sub Slide menu function sliderMenu(){ $("#menu01>.subnav").owlCarousel({ items :4, loop:false, nav:true, animateOut:'fadeOut', animateIn:'fadeIn', URLhashListener:true, startPosition:'URLHash' }); } $(function(){ // allmenu var $allmenu = $("#allmenu"), $btnAllmenu = $("a.btnAllmenu, a.btnClose"), $btnAllmenuClose = $(".btnClose"); $dim = $('.dim'); $headerH = $("#header").height(); //allmenu open $btnAllmenu.click(function(){ //alert("divAllMenu focus !!"); if($allmenu.hasClass('active')){ $allmenu.removeClass('active') $dim.fadeOut(500); $('body').css('overflow-y','auto'); } else { $allmenu.addClass('active'); $dim.fadeIn(500); $('body').css('overflow-y','hidden'); $("#a_allMenu").focus(); } }); //popup open $(".open_popup").click(function(){ $('.popup.type1').fadeIn(); }); $(".close_popup").click(function(){ $('.popup').fadeOut(); }); $(".closePopup").click(function(){ $('.popup.type2').fadeOut(); }); $(".close_alim").click(function(){ $('.alim').slideUp("fast", function(){ containerH(); }); }); //allmenu close $btnAllmenuClose.click(function(){ $allmenu.removeClass('active'); $dim.fadeOut(500); }); /* // gnbMenu $("#gnb>ul>li>a").click(function(e){ var checkElement = $(this).next(); if((checkElement.is('div'))&&(checkElement.is(':visible'))){ checkElement.slideUp('fast',function(){ if(!$(this).parent().hasClass('.current')){ $(this).parent().removeClass('active'); } containerH(); }); } if((checkElement.is('div'))&&(!checkElement.is(':visible'))){ $("#gnb>ul>li").removeClass('active'); $(this).parent().addClass('active'); checkElement.slideDown('fast',function(){ if($("#menu01").is(":visible")){ sliderMenu(); } containerH(); }); } else { $(".slidewrap").slideUp('fast',function(){ containerH(); }); } containerH(); }); */ if($("#menu01").is(":visible")){ sliderMenu(); containerH(); } $(window).load(function(){ $(window).resize(function() { containerH(); }).resize(); $(window).trigger('resize'); }); //equlcol $('.tabs.type1>ul, .tabs.type3>ul, .tabs.type4>ul').each(function(){ var equalcol = $(this).children('li'); equalcol.css('width', 100/equalcol.length + '%'); }); //accordion $('.acdbox').each(function(){ $('.acdbox').accordion({ autoHeight:false, collapsible : true, heightStyle:"content", active:0, animate : 300 }); $(".acdbox>h3").bind("click", function(){ var self = this; setTimeout(function(){ var headerH3 = $("#header").height() ; var headerH4 = $("#header").height() + $(".slidewrap").height(); theOffset = $(self).offset(); if($(".slidewrap").is(":visible")){ $("body, html").scrollTop(theOffset.top - headerH4); } else { $("body,html").scrollTop(theOffset.top - headerH3); } },310); }); }); //scrollTop $(window).scroll(function(event){ var scroll = $(window).scrollTop(); var headerH = $("#header").height(); if (scroll >= headerH) { $(".scrolltop").addClass("show"); } else { $(".scrolltop").removeClass("show"); } }); $('.scrolltop').click(function(e){ e.preventDefault(); var body = $("html, body"); var top = body.scrollTop(); body.animate({scrollTop:0},'slow') }); $(".tabs").each(function(){ $(this).tabs(); }); containerH(); mainslider(); });