/* 탭 */ $(document).ready(function() { $('ul.tabs li a').eq(0).addClass('on'); $('div.tab_box_all div.tabbox').hide(); $('div.tab_box_all div.tabbox').eq(0).show(); $('ul.tabs li a').click(function(i){ $(this).parent().siblings().children('a').removeClass(); $(this).addClass('on'); }); $('ul.tabs li a').each(function(i){ var num = i; $(this).bind('click',function(){ $('div.tab_box_all div.tabbox').hide(); $('div.tab_box_all div.tabbox').eq(num).show(); }); }); }); $(function(){ var timeout, delay = 300; var numDefault = 220; var expNum = 300; $("#hideLeft").click(function(){ if($(this).hasClass("opened")){ $('#aside').animate({left: - numDefault}, {duration: 300}); $('#content').animate({ marginLeft: '0' }, { duration: 300, complete: function() { $("#hideLeft").removeClass("opened").addClass("closed"); $("#hideLeft").animate({right: '-10'}, {duration: 200}); } }); $('#aside').attr("class","closed_aside"); return false; } else { $('#aside').animate({left: '0'}, {duration: 300}); $('#content').animate({ marginLeft: numDefault }, { duration: 300, complete: function() { $("#hideLeft").removeClass("closed").addClass("opened"); $("#hideLeft").animate({right: '0'}, {duration: 200}); } }); $('#aside').attr("class","opened_aside"); return false; } }); /* $('#asideOver').bind('mouseenter', function() { if($(this).hasClass("active")){ if (timeout) window.clearTimeout(timeout); timeout = window.setTimeout(function(){ $('#aside').stop().animate({width: expNum}, {duration: 200}); }, delay); }else{ return; } }); $('#asideOver').bind('mouseleave', function() { if($(this).hasClass("active")){ if (timeout) window.clearTimeout(timeout); timeout = window.setTimeout(function(){ $('#aside').stop().animate({width: numDefault}, {duration: 200}); }, delay); }else{ return; } }); */ }); $(function(){ $("#hideCal").click(function(){ if($(this).hasClass("opened")){ $('#calWrapp').slideUp(300, function() { $("#hideCal").removeClass("opened").addClass("closed"); }); $('#calSet').animate({marginBottom: '0'}, {duration: 300}); return false; } else { $('#calWrapp').slideDown(300, function() { $("#hideCal").removeClass("closed").addClass("opened"); }); $('#calSet').animate({marginBottom: '15'}, {duration: 300}); return false; } }); }); // //$(function(){ // $("#searchUser").focus(function(){ // if($(this).val() != ""){ // $(this).val(""); // }else{ // return; // } // }); // $("#searchUser").blur(function(){ // //alert($("#searchUser").val()); // if($(this).val() == ""){ // $(this).val("); // }else{ // return; // } // }); //}); function uiRefresh(i){ mainTabNum(); //resizeTabBox(); var docHeightOrign = $(document).height()+50; var docHeight = ($(document).height()) - 45; var docHeightF = ($(document).height()) - 30; //var docHeight = ($("#container").height()) - 95; //var docHeightF = ($("#container").height()) - 30; var asideDiv = $("#aside"); var asideOver =$("#asideOver"); var container = $("#container"); var section = $("#section"); if($("#btnFullView").hasClass("full")){ asideDiv.height(docHeightF); asideOver.find("> .menu_tree").height(docHeightF - 45); asideOver.height(docHeightF-30); container.height(docHeightOrign); section.height(docHeightOrign); }else{ asideDiv.height(docHeight); asideOver.find("> .menu_tree").height(docHeight - 45); asideOver.height(docHeight-30); container.height(docHeightOrign); section.height(docHeightOrign); } $(window).scrollTop(0); } function uiRefresh_sports(i){ mainTabNum(); //resizeTabBox(); var docHeightOrign = $(document).height()+50; var docHeight = ($(document).height()) - 45; var docHeightF = ($(document).height()) - 30; //var docHeight = ($("#container").height()) - 95; //var docHeightF = ($("#container").height()) - 30; var asideDiv = $("#aside"); var asideOver =$("#asideOver"); var container = $("#container"); var section = $("#section"); if($("#btnFullView").hasClass("full")){ asideDiv.height(docHeightF); asideOver.find("> .menu_tree").height(docHeightF - 45); asideOver.height(docHeightF-30); container.height(docHeightOrign); section.height(docHeightOrign); }else{ asideDiv.height(docHeight); asideOver.find("> .menu_tree").height(docHeight - 45); asideOver.height(docHeight-30); container.height(docHeightOrign); section.height(docHeightOrign); } } // $(function(){ $("#btnFullView").click(function(){ if($(this).hasClass("normal")){ $("#header").slideUp(300, function(){ uiRefresh(); }); $('#aside').animate({top: '0'}, {duration: 300}); $('#container').animate({marginTop: '0'}, {duration: 300}); $('#content').animate({paddingTop: '0'}, {duration: 300}); if($("#hideLeft").hasClass("opened")){ $("#hideLeft").trigger('click'); } $('#content').animate({marginLeft: '0'}, {duration: 300}); $(this).removeClass("normal").addClass("full"); }else{ $("#header").slideDown(300, function(){ uiRefresh(); }); $('#aside').animate({top: '65'}, {duration: 300}); $('#container').animate({marginTop: '-65'}, {duration: 300}); $('#content').animate({paddingTop: '65'}, {duration: 300}); if($("#hideLeft").hasClass("closed")){ $("#hideLeft").trigger('click'); } $('#content').animate({marginLeft: '220'}, {duration: 300}); $(this).removeClass("full").addClass("normal"); } }); $(window).resize(function() { //console.log($("#content").height()); uiRefresh(); }).resize() }); /* $(function(){ var btnViewLog = $("#viewLog"); var logPop = $("#logPop"); btnViewLog.mouseenter(function () { var t = e.clientY + 17; var l = e.clientX - 105; logPop.css({"top":t,"left":l}); logPop.show(); }); btnViewLog.mouseout(function(){ logPop.hide(); }); }); */ // function resizeTabA(){ var tabLength = $("#tabArea").find("li").length; if(tabLength <= 5){ $("#tabArea").width(525); }else if(tabLength > 5, tabLength <= 10){ $("#tabArea").width(1050); }else if(tabLength > 10, tabLength <= 15){ $("#tabArea").width(1575); }else if(tabLength > 15, tabLength <= 20){ $("#tabArea").width(2100); } } // function mainTabNum(){ var tabLength = $("#tabArea").find("li").length; //if(tabLength < 6){ // $("#btnTabsLeft").hide(); // $("#btnTabsRight").hide(); // $("#btnVeiwAllTab").hide(); //}else{ // $("#btnTabsLeft").show(); // $("#btnTabsRight").show(); // $("#btnVeiwAllTab").show(); //} //resizeTabA(); // } // function viewTabAll(i){ if(i == 1){ $("#tabWrap").removeClass("rolling").addClass("spread"); if( navigator.appName.indexOf("Microsoft") > -1 ){ //IE if( navigator.appVersion.indexOf("MSIE 6") > -1){ //IE6 $("#tabOuter").height($("#tabOuter ul").height()); } else if( navigator.appVersion.indexOf("MSIE 7") > -1){ //IE7 $("#tabOuter").height($("#tabOuter ul").height()); } else { $("#tabOuter").height($("#tabOuter ul").height() - 5); } }else{ $("#tabOuter").height($("#tabOuter ul").height() - 5); } $("#tabArea").css("left","0"); $("#tabArea").css("width",""); $("#btnTabsLeft").attr("class","prev dis"); $("#btnTabsRight").attr("class","next dis"); $("#btnVeiwAllTab").hide(); }else{ $("#tabWrap").removeClass("spread").addClass("rolling"); $("#tabOuter").height(20); $("#btnTabsLeft").attr("class","prev on"); $("#btnTabsRight").attr("class","next off"); $("#btnVeiwAllTab").show(); } } // function resizeTabBox(){ //540 //525 var contWidth = $("# ").width(); var btnsWidth = $("#rightBtns").width(); var tabWidth = 105; var etcWidth = 70; var tabAreaWidth = contWidth - btnsWidth - etcWidth - 15; var intTabCount = parseInt(tabAreaWidth / 105); var tabAreaWidthR = intTabCount*tabWidth; $("#leftTabs").width(tabAreaWidthR + 15); $("#tabOuter").width(tabAreaWidthR); } // function listSwipe(i){ var tabLength = $("#tabArea").find("li").length; var tabWrap = $("#tabArea"); var tabOuterW = parseInt($("#tabOuter").width()); var tabWrapLW = tabOuterW - (105* tabLength); var tabWrapLWEnd = tabOuterW - (105* (tabLength - 1)); var tabWrapRWEnd = -105; var nowLeft = parseInt(tabWrap.css("left")); var moveLeft = nowLeft - 105; var moveRight = nowLeft +105; if(tabWrap.is(':animated')){ return false; }else if($("#leftTabs a").hasClass("dis")){ return false; }else{ if(i == 0){ if(tabWrapLW == nowLeft){ return false; }else if(tabWrapLWEnd == nowLeft){ tabWrap.animate({left: moveLeft }, 400); $("#btnTabsLeft").removeClass("on").addClass("off"); }else{ tabWrap.animate({left: moveLeft }, 400); $("#btnTabsRight").removeClass("off").addClass("on"); } }else{ if(nowLeft == 0){ return false; }else if(tabWrapRWEnd == nowLeft){ tabWrap.animate({left: moveRight }, 400); $("#btnTabsRight").removeClass("on").addClass("off"); }else{ tabWrap.animate({left: moveRight }, 400); $("#btnTabsLeft").removeClass("off").addClass("on"); } } } }