/********************************************************************************************************* ## Common Script ## * º» ½ºÅ©¸³Æ®ÀÇ ÀúÀÛ±ÇÀº (ÁÖ)À¥½º¸®ÆÛºí¸¯¿¡ ÀÖ½À´Ï´Ù. * º» ½ºÅ©¸³Æ®¸¦ ¹«´ÜÀ¸·Î ÀÌ¿ë(¶Ç´Â µµ¿ë)Çϰųª º¹Á¦ ¶Ç´Â ¼öÁ¤ »ç¿ë½Ã ÀúÀ۱ǹý¿¡ ÀǰŠó¹ú¹ÞÀ» ¼ö ÀÖ½À´Ï´Ù. * ±¸¸Å ÈÄ¿¡µµ Á¦ 2Â÷ »çÀÌÆ® µî ¶óÀ̼±½º°¡ Àû¿ëµÇÁö ¾Ê´Â »çÀÌÆ®¿¡ ´ëÇÏ¿© »ç¿ëÀº ±ÝÁöµÇ¾î ÀÖ½À´Ï´Ù. * À§ »çÇ׿¡ ´ëÇÏ¿© À§¹Ý½Ã Àý´ë ÇÕÀÇ´Â ¾ø½À´Ï´Ù ! * date : 2017-09-28 * author : Park Soo Hyun (shpark7502@naver.com) *********************************************************************************************************/ /*------------------------ ¸ÞÀÎÆäÀÌÁö Àü¿ë ½ºÅ©¸³Æ® ------------------------*/ // interval timer function intervalTimer(callback, interval) { var timerId, startTime, remaining = 0; var state = 0; // 0 = idle, 1 = running, 2 = paused, 3= resumed this.pause = function() { if (state != 1) return; remaining = interval - (new Date() - startTime); window.clearInterval(timerId); state = 2; }; this.resume = function() { if (state != 2) return; state = 3; window.setTimeout(this.timeoutCallback, remaining); }; this.timeoutCallback = function() { if (state != 3) return; callback(); startTime = new Date(); timerId = window.setInterval(callback, interval); state = 1; }; startTime = new Date(); timerId = window.setInterval(callback, interval); state = 1; } // ¸ÞÀÎ ºñÁÖ¾ó $(function() { var visualWrap = $("#mainVisual"); var visual = $("#mainVisual > .imgList"); var visual_count = 0; var visual_index = 1; var visual_size; var visual_delay; var visual_timer; if (visualWrap.data('interval')) { visual_delay = visualWrap.data('interval'); } else { visual_delay = 5000; } // Ãʱ⠼¼Æà function setting() { var first_item = visual.children().eq(0).clone(); var last_item = visual.children().eq(-1).clone(); var pagination = ""; var winWidth = $(window).width(); visual_size = winWidth - 60; visual.append(first_item); visual.prepend(last_item); visual_count = visual.children().length; pagination += ''; pagination += ''; pagination += ''; visual.children().find('.typo').append(pagination); visual.children().find('.pagination > li:first').addClass('on'); visual.css({ left: -visual_size, width: visual_size * visual_count }); } // ¸®»çÀÌ¡ ó¸® function resize() { var winWidth = $(window).width(); var winHeight = $(window).height(); visual_size = winWidth - 60; visual.children().css('width', visual_size); visual.css({ left: -visual_size * visual_index, width: visual_size * visual_count }); if (winWidth > 1024) { visualWrap.css('height', winHeight); } else { visualWrap.removeAttr('style'); } } // ½½¶óÀ̵å ÇÔ¼ö function slideVisual(index) { var winWidth = $(window).width(); visual_size = winWidth - 60; if (index != visual_index) { var nPos = -visual_size * index; visual.children().addClass('animate'); visual.stop().delay(400).animate({ left: nPos }, 700, 'easeInOutQuart', function() { if (index < 1) { index = visual_count - 2; nPos = -visual_size * index; visual.css('left', nPos); } if (index > visual_count - 2) { index = 1; nPos = -visual_size * index; visual.css('left', nPos); } visual_index = index; visual.children().find('.pagination > li').removeClass('on'); visual.children().find('.pagination > li:eq(' + (visual_index - 1) + ')').addClass('on'); visual.children().removeClass('animate'); }); } } // ŸÀÌ¸Ó ½ÇÇà function setTimer() { visual_timer = setInterval(function() { var idx = visual_index + 1; slideVisual(idx); }, visual_delay); } // ŸÀÌ¸Ó Á¤Áö function clearTimer() { visual.stop(); clearInterval(visual_timer); } // ÀÌÀü ¹öÆ° $("#mainVisual > .prev").click(function() { if (!visual.is(':animated') && !visual.children().hasClass('animate')) { clearTimer(); var idx = visual_index - 1; slideVisual(idx); setTimer(); } }); // ´ÙÀ½ ¹öÆ° $("#mainVisual > .next").click(function() { if (!visual.is(':animated') && !visual.children().hasClass('animate')) { clearTimer(); var idx = visual_index + 1; slideVisual(idx); setTimer(); } }); resize(); setting(); setTimer(); $(window).resize(function() { resize(); }); }); // ¸ÞÀÎ ·Ñ¸µ¹è³Ê À̹ÌÁö (¼½¼Ç1) $(function() { var slide_index = 0; var slide_size; var sliderWrap = $("#imgSlider"); var slider = sliderWrap.find('.imgList'); var slide_count = slider.children().length; var slide_timer; var slide_term; var slide_timer_first = true; var easeEffect = "easeInOutQuart"; // ·Ñ¸µ Áֱ⠼³Á¤ if (!sliderWrap.data('interval')) { slide_term = 4000; } else { slide_term = sliderWrap.data('interval'); } // Ãʱ⠼¼Æà function setting() { var paging = ""; slide_size = slider.children().width(); slider.children().css({ left: -slide_size }); slider.children().eq(slide_index).css({ left: 0 }); slider.children().eq(slide_index + 1).css({ left: slide_size }); paging += ''; paging += '
    '; for (i = 0; i < slide_count; i++) { paging += '
  1. '; } paging += '
'; paging += ''; sliderWrap.append(paging); sliderWrap.find('.pagination > li:first').addClass('on'); } // ½½¶óÀ̵å ÇÔ¼ö function slide(direction) { var before_index; if (!direction || direction === 'next') { slide_size = slider.children().width(); if (slide_index >= slide_count) { slide_index = 0; before_index = slide_count - 1; } else { before_index = slide_index - 1; } } else { slide_size = -(slider.children().width()); if (slide_index < 0) { slide_index = slide_count - 1; before_index = 0; } else { before_index = slide_index + 1; } } sliderWrap.find('.pagination > li').removeClass('on'); sliderWrap.find('.pagination > li .bar').css({ width: 0 }); sliderWrap.find('.pagination > li:eq(' + slide_index + ')').addClass('on'); slider.children().eq(slide_index).css({ left: slide_size }); slider.children().eq(slide_index).animate({ left: 0 }, 500, easeEffect); slider.children().eq(before_index).css({ left: 0 }); slider.children().eq(before_index).animate({ left: -slide_size }, 500, easeEffect); } // ÀÚµ¿ ½½¶óÀ̵å function autoslide() { sliderWrap.find('.pagination > li:eq(' + slide_index + ') > .bar').animate({ width: '100%' }, slide_term - 100, function() { slide_index++; slide('next'); }); } // ŸÀÌ¸Ó ½ÃÀÛ function startTimer() { slide_timer = new intervalTimer(function() { autoslide(); }, slide_term); } // ŸÀÌ¸Ó º¹±Í function resumeTimer() { slide_timer.resume(); } // ŸÀÌ¸Ó ÀϽÃÁ¤Áö function pauseTimer() { slider.children().stop(); sliderWrap.find('.pagination > li > .bar').stop(); slide_timer.pause(); } // ŸÀÌ¸Ó ÃʱâÈ­ function clearTimer() { slider.children().stop(); sliderWrap.find('.pagination > li > .bar').stop(); slide_timer.timeoutCallback(); } // ÀÌÀü ¹öÆ° sliderWrap.find('.prev').click(function() { if (!slider.children().is(':animated')) { clearTimer(); slide_index--; slide('prev'); resumeTimer(); } }); // ´ÙÀ½ ¹öÆ° sliderWrap.find('.next').click(function() { if (!slider.children().is(':animated')) { clearTimer(); slide_index++; slide('next'); resumeTimer(); } }); // ¸¶¿ì½º ¿À¹ö½Ã ŸÀÌ¸Ó ÀϽÃÁ¤Áö slider.mouseenter(function() { if (!slider.children().is(':animated')) { pauseTimer(); } }); // ¸¶¿ì½º ¿À¹ö ÇØÁ¦½Ã ŸÀÌ¸Ó º¹±Í slider.mouseleave(function() { if (!slider.children().is(':animated')) { resumeTimer(); } }); setting(); autoslide(); startTimer(); }); /*------------------------ ¼­ºê ½ºÅ©¸³Æ® ------------------------*/ // URL ÆĶó¹ÌÅÍ ÆÄ½Ì ÇÔ¼ö var getUrlParameter = function getUrlParameter(sParam) { var sPageURL = decodeURIComponent(window.location.search.substring(1)), sURLVariables = sPageURL.split('&'), sParameterName, i; for (i = 0; i < sURLVariables.length; i++) { sParameterName = sURLVariables[i].split('='); if (sParameterName[0] === sParam) { return sParameterName[1] === undefined ? true : sParameterName[1]; } } }; // PC ÇØ»óµµ ¿©ºÎ üũ ÇÔ¼ö function isPC() { var $winWidth = $(window).width(); if ($winWidth > 1024) { return true; } else { return false; } } // ¼­ºê ºñÁÖ¾ó À̹ÌÁö $(function() { if ($("#subVisual").length) { $("#subVisual").wrFadeSlide({ paging: false, // ÆäÀÌÁö³×ÀÌ¼Ç ±â´É »ç¿ë¿©ºÎ (±âº»°ª : true / ºñÈ°¼ºÈ­½Ã false ÀÔ·Â) autoplay: true, // ÀÚµ¿ ·Ñ¸µ ±â´É »ç¿ë¿©ºÎ (±âº»°ª : true / ºñÈ°¼ºÈ­½Ã false ÀÔ·Â) interval: 4000 // ÀÚµ¿ ·Ñ¸µ ÁÖ±â (´ÜÀ§ : ms, ±âº»°ª : 3000) }); } }); // ¼­ºê¸Þ´º ¹× ºñÁÖ¾ó ŸÀÌƲ È°¼ºÈ­ $(function() { var $subContainer = $("#subContainer"); // 1Â÷ µå·Ó´Ù¿î ¸Þ´º ÀÚµ¿ »ý¼º function majorCreate() { var $d1url = []; var $d1title = []; var $d1html; var i = 0; $("#lnb > li").each(function() { $d1url[i] = $(this).children('a').attr('href'); $d1title[i] = $(this).children('a').text(); i++; }); for (n = 1; n < i; n++) { $d1html = '
  • ' + $d1title[n] + '
  • '; $("#nav .depth1 .mnuList").append($d1html); } } majorCreate(); // 2Â÷ µå·Ó´Ù¿î ¸Þ´º ÀÚµ¿ »ý¼º function minorCreate() { var $d2url = []; var $d2title = []; var $d2html; var $currIndex = 0; if ($subContainer.data('menu-special')) { $currIndex = $subContainer.data('menu-special'); } else { $currIndex = getUrlParameter('top'); } var i = 0; $("#lnb > li").each(function() { if ($(this).index() == $currIndex) { for (i = 0; i < $(this).find('ul').children().length; i++) { $d2url[i] = $(this).find('ul').children().eq(i).find('a').attr('href'); $d2title[i] = $(this).find('ul').children().eq(i).find('a').text(); } } }); for (n = 0; n < i; n++) { $d2html = '
  • ' + $d2title[n] + '
  • '; $("#nav .depth2 .mnuList").append($d2html); } } minorCreate(); // 1Â÷ µå·Ó´Ù¿î ¸Þ´º È°¼ºÈ­ function majorActive() { var currIndex = 0; if ($subContainer.data('menu-special')) { currIndex = $subContainer.data('menu-special') - 1; } else { currIndex = getUrlParameter('top') - 1; } var currMenu = $("#nav .depth1 ul.mnuList li").eq(currIndex).text(); $("#nav .depth1 > a > span").text(currMenu); } // 2Â÷ µå·Ó´Ù¿î ¸Þ´º È°¼ºÈ­ function minorActive() { var currIndex = getUrlParameter('sub') - 1; if ($subContainer.data('sub-special')) { currIndex = $subContainer.data('sub-special') - 1; } else { currIndex = getUrlParameter('sub') - 1; } var currMenu = $("#nav .depth2 ul.mnuList li").eq(currIndex).text(); $("#nav .depth2 > a > span").text(currMenu); } // ¼­ºê ºñÁÖ¾ó ÅؽºÆ® ÀÚµ¿ µ¿±âÈ­ function initTitle() { var majorTitle = $("#nav .depth1 > a > span").text(); var minorTitle = $("#nav .depth2 > a > span").text(); $("#subVisual > .title > .inner > h2").text(majorTitle); $("#subVisual > .title > .inner > h3").text(minorTitle); } // µå·Ó¹Ú½º ¸Þ´º Ŭ¸¯ ó¸® $("#nav .dropdown > a").click(function() { if (!$(this).parent('.dropdown').hasClass('open')) { $("#nav .dropdown").removeClass('open'); $("#nav .dropdown > ul.mnuList").stop(true, false).slideUp(300); $(this).parent('.dropdown').addClass('open'); $(this).siblings('ul.mnuList').stop(true, false).slideDown(300); } else { $(this).parent('.dropdown').removeClass('open'); $(this).siblings('ul.mnuList').stop(true, false).slideUp(300); } }); // µå·Ó¹Ú½º ¿Ü ¿µ¿ª Ŭ¸¯½Ã µå·Ó´Ù¿î ¸Þ´º Á¢À½ $(document).click(function(e) { if (!$(e.target).is('#nav .dropdown a, #nav .dropdown a span')) { $("#nav .dropdown").removeClass('open'); $("#nav .dropdown > ul.mnuList").stop(true, false).slideUp(300); } }); // ¸ð¹ÙÀÏ ¸Þ´º È°¼ºÈ­ function activeMobileNav() { var topIndex = getUrlParameter('top'); var subIndex = getUrlParameter('sub') - 1; $("#lnb > li").eq(topIndex).addClass('on open'); $("#lnb > li").eq(topIndex).find('ul').css('display', 'block'); $("#lnb > li").eq(topIndex).find('ul').children().eq(subIndex).addClass('on'); } // µå·Ó¹Ú½º ¸Þ´º µ¿±âÈ­ $(window).load(function() { majorActive(); minorActive(); initTitle(); activeMobileNav(); }); }); /*------------------------ °¶·¯¸® ½ºÅ©¸³Æ® ------------------------*/ // Æ÷Åä°¶·¯¸® Ä¿½ºÅ͸¶ÀÌ¡ $(function() { var subject = new Array(); // °¶·¯¸® ½æ³×ÀÏ Á¦¸ñ ¹è¿­º¯¼ö ¼±¾ð var content = new Array(); // °¶·¯¸® ½æ³×ÀÏ ³»¿ë ¹è¿­º¯¼ö ¼±¾ð var url = new Array(); // °¢ ½æ³×ÀϺ° ¸µÅ© ÀúÀå¿ë º¯¼ö var url2 = new Array(); // °¢ ½æ³×ÀϺ° ¸µÅ© ÀúÀå¿ë º¯¼ö var url3 = new Array(); // °¢ ½æ³×ÀϺ° ¸µÅ© ÀúÀå¿ë º¯¼ö var thumbCount; // ½æ³×ÀÏ °³¼ö (ÃßÃâ°³¼ö) var refHeight; // ³ôÀÌ µ¿±âÈ­¸¦ À§ÇÑ º¯¼ö // °¶·¯¸® Ãʱ⼼Æà function galleryInit() { if ($(".bbsnewf5").length > 0) { thumbCount = $(".gallery_inner .bbsnewf5").length; if ($(".hoverBox").length > 0) { $(".hoverBox").parent('a').remove(); } for (i = 0; i < thumbCount; i++) { url[i] = $(".gallery_inner .bbsnewf5").eq(i).find('a:first').attr('href'); subject[i] = $(".gallery_inner .bbsnewf5").eq(i).find('.gallery_title').text(); content[i] = $(".gallery_inner .bbsnewf5").eq(i).find('.gallery_etc').text().replace('[°£·«¼³¸í : ', '').replace(']', ''); // ½æ³×ÀÏ ÀÖ´Â td ³»ºÎ¿¡ hover È¿°ú¸¦ ÁÖ±â À§ÇÑ ¹Ú½º ÅÂ±× »ý¼º (°¢°¢ ½æ³×ÀÏ ³»¿¡ ¹Ýº¹¹®À¸·Î »ðÀÔ) $(".gallery_inner .bbsnewf5").eq(i).find('table td:first').append('

    ' + subject[i] + '

    ' + $.trim(content[i]) + '

    '); } // ±âÁ¸¿¡ º¸¿©Áö´Â º°µµ td ÀÇ Á¦¸ñ, ³»¿ëÀº ¼û±è $(".gallery_subject, .gallery_etc").css('display', 'none'); } }; // À¥Áø ¹öÆ°»ý¼º function galleryInit2() { if ($(".webzine_type2 tr").length > 0) { thumbCount = $(".gallery_inner .webzine_type2 tr").length; if ($(".webzine_btn").length > 0) { $(".webzine_btn").parent('a').remove(); } for (i = 0; i < thumbCount; i++) { //url2[i] = $(".gallery_inner .webzine_type_img_td span").eq(i).find('a:first').attr('href'); url2[i] = $(".gallery_inner .webzine_type_text_td_left dl dd.webzine_add3").eq(i).find('span.obj_value').text(); //url3[i] = $(".gallery_inner .webzine_type_text_td_left dl dd.webzine_add2").eq(i).find('span.obj_value').text(); // ½æ³×ÀÏ ÀÖ´Â td ³»ºÎ¿¡ hover È¿°ú¸¦ ÁÖ±â À§ÇÑ ¹Ú½º ÅÂ±× »ý¼º (°¢°¢ ½æ³×ÀÏ ³»¿¡ ¹Ýº¹¹®À¸·Î »ðÀÔ) //$(".gallery_inner .webzine_type2 .webzine_type_text_td_left").eq(i).find('dl:first').append('
    ÀÚ¼¼È÷º¸±â
    '); $(".gallery_inner .webzine_type2 .webzine_type_text_td_left").eq(i).find('dl:first').append('
    Áöµµ¹Ù·Î°¡±â
    '); //$(".gallery_inner .webzine_type2 .webzine_type_text_td_left").eq(i).find('dl:first').append('
    Áöµµ
    '); } } } // Å×ÀÌºí ¾Ö´Ï¸ÞÀÌ¼Ç function tableShow() { if ($(".gallery_inner").length > 0) { $(".gallery_inner > table").each(function() { if (!$(this).hasClass('-shown')) { $(this).addClass('-shown'); } $(this).addClass('scrollreveal'); }); } } // ´õº¸±â¹öÆ° »ý¼º function createMoreBtn() { var pageCount = $(".brd_paging").find('a').length; if ($(".gallery_inner").length > 0) { if (pageCount > 0) { var btn = ''; $(".board_bottom").before(btn); } } } galleryInit(); galleryInit2(); tableShow(); createMoreBtn(); // ¸ðµç ¿¤¸®¸ÕÆ® ·Îµå ÈÄ $(window).load(function() { var loadIndex = 1; var wrapper; var moreFlag = false; var path = $(location).attr('pathname'); if ($(".gallery_inner").length > 0) { wrapper = $(".gallery_inner"); } // °ü¸®ÀÚ¹öÆ° »èÁ¦ function adminRemove() { $(".gallery_inner > table").each(function() { if ($(this).attr('bordercolor')) { $(this).remove(); } }); } // ºó Å×ÀÌºí »èÁ¦ function emptyRemove() { $(".gallery_inner > table").each(function() { if ($(this).find('td').length < 1) { $(this).remove(); } }); } // ¸¶Áö¸· ÆäÀÌÁöÀÎÁö üũ function isLastPage() { var currPage = parseInt($(".brd_paging b").text()); var pages = $(".brd_paging a"); var maxPage = 0; pages.each(function() { var cnt = parseInt($(this).text()); if (cnt >= maxPage) maxPage = cnt; }); if (currPage >= maxPage) { return true; } else { return false; } } // ajax ·Îµå ó¸® function photoLoadByURL(link) { var temp; var paging; adminRemove(); emptyRemove(); $.ajax({ url: link, contentType: 'application/x-www-form-urlencoded;charset=euc-kr', beforeSend: function(x) { x.overrideMimeType('application/x-www-form-urlencoded;charset=euc-kr'); }, success: function(data) { temp = $(data).find('.gallery_inner').html(); paging = $(data).find('.brd_paging').html(); $(".brd_paging").html(''); $(".brd_paging").html(paging); var pageCount = $(".brd_paging").find('a').length; if (loadIndex >= pageCount) $("#btnMoreLoad").remove(); if (moreFlag === true) { wrapper.append(temp); } else { wrapper.html(temp); } tableShow(); wrapper.children().css('opacity', '0'); wrapper.children().animate({ 'opacity': '1' }, 400, function() { wrapper.children().css({ 'opacity': '' }); }); emptyRemove(); galleryInit(); galleryInit2(); admBtnReplace(); if (pageCount > 0 && !isLastPage() && $("#btnMoreLoad").length < 1) createMoreBtn(); }, error: function() { wrapper.html('¿À·ù : Á¤»óÀûÀ¸·Î ·ÎµåµÇÁö ¾Ê¾Ò½À´Ï´Ù.'); } }); } // ´õº¸±â ¹öÆ° Ŭ¸¯½Ã $(document).on('click', '#btnMoreLoad', function() { var pageCount = $(".brd_paging").find('a').length; var catePath = $(".board_tab > ul > li.on a").attr('href'); if (loadIndex < pageCount) { loadIndex++; } else { loadIndex++; $("#btnMoreLoad").attr('disabled', 'disabled'); } var url = catePath + '&com_board_page=' + loadIndex; moreFlag = true; photoLoadByURL(url); }); // Ä«Å×°í¸® ÅÇ Å¬¸¯½Ã $(document).on('click', '.board_tab > ul > li > a', function(e) { var url = $(this).attr('href'); moreFlag = false; loadIndex = 1; if (!isPC()) { $(".board_tab > a").removeClass('open'); $(".board_tab > a").text($(this).text()); $(".board_tab > ul").css('display', 'none'); } e.preventDefault(); $(".board_tab > ul > li").removeClass('on'); $(this).parent().addClass('on'); photoLoadByURL(url); }); emptyRemove(); }); // Ä«Å×°í¸® °ü·Ã º¯¼ö ¼±¾ð var cate_link = [], cate_title = [], currentURL = $(location).attr('pathname'), param = "?&com_board_category_code=", currentParam = "", insertHTML = "", idx = 0; // ¼¿·ºÆ®¹Ú½º ¸µÅ©È­ if ($("select[name='com_board_category_code']").length > 0) { currentParam = getUrlParameter('com_board_category_code'); $("select[name='com_board_category_code'] > option").each(function() { cate_link[idx] = $(this).val(); cate_title[idx] = $(this).text(); idx++; }); insertHTML = '
    '; insertHTML += '' + cate_title[0] + ''; insertHTML += ''; insertHTML += '
    '; $(".cate_select").before(insertHTML); $.each(cate_link, function(m, key) { if (key == currentParam) { $(".board_tab > a").text(cate_title[m]); $(".board_tab > ul > li[data-category='" + key + "']").addClass('on'); } }); if (!currentParam) { $(".board_tab > ul > li:first").addClass('on'); } } // Ä«Å×°í¸® ¸µÅ© Ŭ¸¯½Ã $(document).on('click', '.board_tab > a', function() { if (!isPC()) { if (!$(this).hasClass('open')) { $(this).addClass('open'); $(this).next('ul').css('display', 'block'); } else { $(this).removeClass('open'); $(this).next('ul').css('display', 'none'); } } }); // À©µµ¿ì ¸®»çÀÌ¡ ó¸® (Ä«Å×°í¸® Ç׸ñ enable/disable) $(window).bind('resize', function() { if (isPC() && $(".board_tab").length > 0) { $(".board_tab > ul").css('display', 'block'); } else if (!isPC()) { if (!$(".board_tab > a").hasClass('open')) { $(".board_tab > ul").css('display', 'none'); } } }); // °ü¸®ÀÚ Àü¿ë ¹öÆ° replace (ajax ·Îµå½Ã¸¶´Ù È£Ãâ) function admBtnReplace() { var $url = window.location.href; var $readpage = $url.indexOf('read_form'); $("#subContainer img").each(function() { var $src = $(this).attr('src'); // »èÁ¦ if ($src.indexOf('btn_sdel.gif') > -1 && $readpage < 0) { var $opt = $(this).attr('onclick'); var $link = "»èÁ¦"; $(this).before($link); $(this).remove(); } // À̵¿ if ($src.indexOf('move.gif') > -1 && $readpage < 0) { var $opt = $(this).attr('onclick'); var $link = "À̵¿"; $(this).before($link); $(this).remove(); } // º¹»ç if ($src.indexOf('copy.gif') > -1 && $readpage < 0) { var $opt = $(this).attr('onclick'); var $link = "º¹»ç"; $(this).before($link); $(this).remove(); } // À̵¿ (ºäÆäÀÌÁö) if ($src.indexOf('move.gif') > -1 && $readpage > -1) { $(this).parent('a').addClass('btn btn-default btn-sm'); $(this).parent('a').html('À̵¿'); $(this).remove(); } // º¹»ç (ºäÆäÀÌÁö) if ($src.indexOf('copy.gif') > -1 && $readpage > -1) { $(this).parent('a').addClass('btn btn-default btn-sm'); $(this).parent('a').html('º¹»ç'); $(this).remove(); } // ÃßõÇϱâ (ºäÆäÀÌÁö) if ($src.indexOf('recommend.gif') > -1 && $readpage > -1) { $(this).parent('a').addClass('btn btn-default'); $(this).parent('a').html('ÃßõÇϱâ'); $(this).remove(); } // ¼öÁ¤ (ºäÆäÀÌÁö) if ($src.indexOf('modify.gif') > -1 && $readpage > -1) { $(this).parent('a').addClass('btn btn-default'); $(this).parent('a').html('¼öÁ¤'); $(this).remove(); } // »èÁ¦ (ºäÆäÀÌÁö) if ($src.indexOf('delete.gif') > -1 && $readpage > -1) { $(this).parent('a').addClass('btn btn-default'); $(this).parent('a').html('»èÁ¦'); $(this).remove(); } // ´ä±Û (ºäÆäÀÌÁö) if ($src.indexOf('reply.gif') > -1 && $readpage > -1) { $(this).parent('a').addClass('btn btn-default'); $(this).parent('a').html('´ä±Û¾²±â'); $(this).remove(); } }); } // ÀÏ¹Ý ±â´É¹öÆ° replace function btnReplace() { $("#subContainer img").each(function() { var $src = $(this).attr('src'); // ±Û¾²±â if ($src.indexOf('write.gif') > -1) { $(this).parent('a').addClass('btn btn-primary'); $(this).parent('a').html('±Û¾²±â'); $(this).remove(); } // ÀÌÀü if ($src.indexOf('prev.gif') > -1) { $(this).parent('a').addClass('btn btn-default btn-sm'); $(this).parent('a').html('ÀÌÀü'); $(this).remove(); } // ¸ñ·Ïº¸±â if ($src.indexOf('list.gif') > -1) { $(this).parent('a').addClass('btn btn-default btn-sm'); $(this).parent('a').html('¸ñ·Ï'); $(this).remove(); } // ´ÙÀ½ if ($src.indexOf('next.gif') > -1) { $(this).parent('a').addClass('btn btn-default btn-sm'); $(this).parent('a').html('´ÙÀ½'); $(this).remove(); } // ½ºÆԽŰí if ($src.indexOf('spam.gif') > -1) { var $opt = $(this).attr('onclick'); var $link = '½ºÆԽŰí'; $(this).before($link); $(this).remove(); } }); // °Ë»ö $("#ext_search input[type=image]").before(''); $("#ext_search input[type=image]").css('display', 'none'); $(document).on('click', '#ext_search input[type=submit]', function() { $("#ext_search input[type=image]").trigger('click'); }); // ´ñ±Û´Þ±â if ($(".board_comment_bgcolor input[type=image]").length > 0) { var $link = ''; $(".board_comment_bgcolor input[type=image]").before($link); $(".board_comment_bgcolor input[type=image]").css('display', 'none'); } $(document).on('click', '.board_comment_bgcolor input[type=submit]', function() { $(".board_comment_bgcolor input[type=image]").trigger('click'); }); } admBtnReplace(); btnReplace(); }); /*------------------------ Æû¸ÞÀÏ ½ºÅ©¸³Æ® ------------------------*/ // Æû¸ÞÀÏ placehold Ãß°¡ $(function() { if ($(".tbl_formmail").length > 0) { var $form = $(".tbl_formmail"); $form.find('input[name=name]').attr('placeholder', 'Name'); $form.find('input[name=receiver_email]').attr('placeholder', 'Email'); $form.find('textarea[name=description]').attr('placeholder', 'Message'); } }); /*------------------------ °øÅë ½ºÅ©¸³Æ® ------------------------*/ var prevScrTop = $(window).scrollTop(), newScrTop = $(window).scrollTop(), prevDir = 'down', newDir = 'down'; var checkScroll = false; // Çì´õ ¿À¹öÈ¿°ú ¹× ½ºÅ©·Ñ ¹öÆ° Ŭ¸¯ À̺¥Æ® $(function() { var scrollBtn = $("#scrollTop"); var header = $("#header"); header.mouseenter(function() { if (!header.hasClass('hover')) header.addClass('hover'); }).mouseleave(function() { header.removeClass('hover'); }); scrollBtn.click(function() { $("html, body").stop().animate({ scrollTop: 0 }, 600, 'easeInOutQuart'); }); }); $(window).scroll(function() { var scrTop = $(this).scrollTop(); newScrTop = $(window).scrollTop(); var firstSection; var firstTop; var header = $("#header"); var isMain = $("#mainContainer").length ? true : false; var winWidth = $(window).width(); var fixCheck = false; var scrollBtn = $("#scrollTop"); if (newScrTop > prevScrTop) { newDir = 'down'; } else if (newScrTop < prevScrTop) { newDir = 'up'; } if (isMain && winWidth > 1920 && !$("#mainContainer #imgSlider > .imgList li").hasClass('animate')) { firstSection = $("#mainContainer > #section1"); firstTop = firstSection.offset().top - 160; if (newDir == 'down' && scrTop < 100) { $("html, body").stop().animate({ scrollTop: (firstTop + 80) + 'px' }, 400); checkScroll = false; } else if (newDir == 'up' && scrTop < firstTop + 160) { if (checkScroll === false) { $("html, body").stop().animate({ scrollTop: 0 }, 400); } checkScroll = true; } } else { firstTop = $("#header").height(); } if (scrTop >= firstTop) { if (!header.hasClass('fixed') && fixCheck === false) { header.addClass('fixed'); scrollBtn.addClass('active'); fixCheck = true; } } else { header.removeClass('fixed'); scrollBtn.removeClass('active'); fixCheck = false; } prevDir = newDir; prevScrTop = newScrTop; }); $(function() { function lnbOpen() { $("#lnbOpener").addClass('open'); $("#lnbWrapper > .inner").stop().animate({ right: 0 }, 600, 'easeInOutQuart'); $("#lnbWrapper > .lnb-mask").stop().fadeIn(600); } function lnbClose() { var menuWidth = $("#lnbWrapper > .inner").width(); $("#lnbOpener").removeClass('open'); $("#lnbWrapper > .inner").stop().animate({ right: -menuWidth }, 600, 'easeInOutQuart'); $("#lnbWrapper > .lnb-mask").stop().fadeOut(600); } $("#lnbOpener").click(function() { if (!$(this).hasClass('open')) { lnbOpen(); } else { lnbClose(); } }); $("#lnbWrapper > .lnb-mask").click(function() { lnbClose(); }) $("#lnb > li > a").click(function(e) { var winWidth = $(window).width(); if (winWidth < 1025) { if ($(this).siblings('ul').length) e.preventDefault(); if (!$(this).parent().hasClass('open')) { $("#lnb > li").removeClass('open'); $("#lnb > li > ul").stop().slideUp(300); $(this).parent().addClass('open'); $(this).siblings('ul').stop().slideDown(300); } else { $(this).parent().removeClass('open'); $(this).siblings('ul').stop().slideUp(300); } } }); }); // ·Îµù ¾Ö´Ï¸ÞÀÌ¼Ç $(window).load(function() { $("#page-loader").fadeOut(400, function() { var delay = setTimeout(function() { $("#page-loader").remove(); }, 200); }); }); // ¸Þ´º Á¦ÀÌÄõ¸® $(document).ready(function(){ var wSize; var headerTop = $("#nav").offset().top; $(window).scroll(function() { wSize = $(window).width(); if(wSize > 1024) { var scrollTop = $(this).scrollTop(); var hd = $("#subContainer"); if(scrollTop >= headerTop - 96) { hd.addClass('fixed'); } else { hd.removeClass('fixed'); } } wSize = $(window).width(); if(wSize < 1024) { var scrollTop = $(this).scrollTop(); var hd = $("#subContainer"); if(scrollTop >= headerTop - 70) { hd.addClass('fixed'); } else { hd.removeClass('fixed'); } } }); });