$(function () { function webHeight() { var winHeight = $(window).height(); if (winHeight > 644) { $("#slidemenu").css("height", winHeight - 167) } else { $("#slidemenu").css("height", "480px") } var winWidth = $(window).width(); if (winWidth > 1179) { var boxHeight = $(window).height() / 4; var arrowTop = boxHeight / 2 - 20; if (boxHeight > 100) { $(".box").css("height", boxHeight); $(".arrow").css("top", arrowTop); $(".notice").css("height", boxHeight - 1); var minboxtop = boxHeight - 190; if (minboxtop < 24) { $(".box").find("h2").css("margin-top", "24px") } else { $(".box").find("h2").css("margin-top", minboxtop) } var sheetTop = (boxHeight - 200) / 2; $(".sheet a").css("top", sheetTop); $(".sheet2 a").css("top", sheetTop); $(".sheet3 a").css("top", sheetTop); $(".play").css("top", sheetTop) } else { if (winWidth > 760) { $(".box").css("height", "100px"); $(".arrow").css("top", "80px"); $(".notice").css("height", "199px"); $(".box").find("h2").css("margin-top", "24px") } else { $(".box").css("height", "164px"); $(".arrow").css("top", "61px"); $(".notice").css("height", "163px"); $(".box").find("h2").css("margin-top", "15px") } } } else { if (winWidth > 1179) { $(".box").css("height", "200px"); } else { $(".box").css("height", "200px"); } } } function check() { var winWidth = $(window).width(); var winHeight = $(window).height(); var allwrapHeight = $("#allwrap").height(); $("#mNavi").css("height", allwrapHeight); if (winWidth > 1179) {} else if (winWidth < 1180 && winWidth > 767) { var menuRight = 436; } else if (winWidth < 768 && winWidth > 319) { var menuRight = 228; } $("#menuOpen").click(function () { var allwrapHeight = $("#allwrap").height(); $("#mNavi").css("display", "block"); $("#mNavi").css("height", allwrapHeight); $("#mNavi").stop().animate({ "left": "0" }, 300) }); $("#mtitle a").click(function () { $("#mNavi").stop().animate({ "left": -menuRight + "px" }, 300) }); $(".dep").click(function () { $("#mgnb ul li ul").hide(); $(this).siblings("ul").show() }); } $(window).resize(function () { var winWidth = $(window).width(); var winHeight = $(window).height(); if (winWidth > 1190) { $('html').animate({ scrollTop: 0 }, 0); $('body').animate({ scrollTop: 0 }, 0); } check(); webHeight(); $("#mNavi").css("display", "block"); }); check(); webHeight() }); function gnbController1(mainClass, subClass){ var mainChk = $("#tab>ul>li>a"); for(var i = 0; i < mainChk.length ; i++){ var subChk = $("#tab>ul>li").eq(i); if(subChk.find("a").eq(0).text() == mainClass) { subChk.eq(0).addClass("on"); for (var z = 0; z < subChk.find("li>a").length; z++){ if(subChk.find("li>a").eq(z).text() == subClass){ subChk.find("li").eq(z).addClass("on"); } }; }; }; }; $(function() { $(".video_box").click(function() { var wHeight = $(window).height(); if(!$("#videolayer").is(':visible')) { $("#mask").css('display','block'); $("#videolayer").html(''); $("#videolayer").html(''); $("#videolayer iframe").load(function() { $("#videolayer").css({top:(wHeight / 5) + 'px', display:'block'}); }); } }); $("#mask").click(function(e) { if($("#videolayer").is(':visible')) { $(this).css('display','none'); $("#videolayer").css('display','none'); } }); });