// 메인 포스팅 롤링 $(function() { var $postElem = $(".postSlider"), $twElem = [], $iwElem = [], $postIndex = [], $postCount = [], $twSize = [], $iwSize = []; $postElem.each(function(i) { $twElem[i] = $(this).find('.textWrapper ul'); $iwElem[i] = $(this).find('.imgWrapper ul'); $postIndex[i] = 0; $postCount[i] = $twElem[i].children().length; i++; }); // 슬라이더 초기화 function postSliderInit() { for(i=0; i<$postElem.length; i++) { $twSize[i] = $twElem[i].parent().width(); $iwSize[i] = $iwElem[i].parent().width(); $twElem[i].children().css('width', $twSize[i] + 'px'); $twElem[i].css({'width':$twSize[i] * $postCount[i] + 'px', 'transform':'matrix(1,0,0,1,' + (-$twSize[i] * $postIndex[i]) + ',0)'}); $iwElem[i].children().css('width', $iwSize[i] + 'px'); $iwElem[i].css({'width':$iwSize[i] * $postCount[i] + 'px', 'transform':'matrix(1,0,0,1,' + (-$iwSize[i] * $postIndex[i]) + ',0)'}); } } // 포스트 슬라이드 함수 function postSliding(idx, easing) { if($postIndex[idx] < 0) { $postIndex[idx] = $postCount[idx] - 1; } else if($postIndex[idx] >= $postCount[idx]) { $postIndex[idx] = 0; } $twElem[idx].parents('.postSlider').find('.thumbList').children().removeClass('on'); $twElem[idx].parents('.postSlider').find('.thumbList').children().eq($postIndex[idx]).addClass('on'); if(!easing || easing == true) { TweenMax.to($iwElem[idx], 0.5, {x:-($iwSize[idx] * $postIndex[idx]), ease:Expo.easeInOut}); TweenMax.to($twElem[idx], 0.7, {x:-($twSize[idx] * $postIndex[idx]), ease:Expo.easeInOut}); } else if(easing == false) { TweenMax.to($iwElem[idx], 0.5, {x:-($iwSize[idx] * $postIndex[idx])}); TweenMax.to($twElem[idx], 0.7, {x:-($twSize[idx] * $postIndex[idx])}); } } // 포스트 슬라이더 썸네일 생성 function postThumbInit() { var $thumbTag = [], $thumbImg = []; for(i=0; i<$postElem.length; i++) { for(n=0; n<$postCount[i]; n++) { $thumbImg[n] = $iwElem[i].children().eq(n).find('img').attr('src'); $thumbTag[n] = '
  • '; $postElem.eq(i).find('.thumbList').append($thumbTag[n]); } $postElem.eq(i).find('.thumbList').children().eq(0).addClass('on'); } } // 상단 포스트 슬라이더 썸네일 클릭 $(document).on('click', '.section1 .thumbList > li', function() { var $tIndex = $(this).index(); $postIndex[0] = $tIndex; postSliding(0); }); // 상단 포스트 슬라이더 이전 $(".section1 .prev").click(function() { $postIndex[0]--; postSliding(0); }); // 상단 포스트 슬라이더 다음 $(".section1 .next").click(function() { $postIndex[0]++; postSliding(0); }); // 하단 포스트 슬라이더 썸네일 클릭 $(document).on('click', '#postSliderType2 .thumbList > li', function() { var $tIndex = $(this).index(); $postIndex[1] = $tIndex; postSliding(1); }); // 하단 포스트 슬라이더 이전 $(".section3 .prev").click(function() { $postIndex[1]--; postSliding(1); }); // 하단 포스트 슬라이더 다음 $(".section3 .next").click(function() { $postIndex[1]++; postSliding(1); }); // 상단 포스트 슬라이더 썸네일 클릭 $(document).on('click', '.section6 .thumbList > li', function() { var $tIndex = $(this).index(); $postIndex[2] = $tIndex; postSliding(2); }); // 상단 포스트 슬라이더 이전 $(".section6 .prev").click(function() { $postIndex[2]--; postSliding(2); }); // 상단 포스트 슬라이더 다음 $(".section6 .next").click(function() { $postIndex[2]++; postSliding(2); }); postSliderInit(); postThumbInit(); // 윈도우 사이즈 조절시 포스트 슬라이더 사이즈, 위치 맞춤 $(window).bind('resize', function() { postSliderInit(); }); }); // 메인 롤링이미지 $(function() { var $vIndex = 0; var $vElem = $("#mainSlider > .imgList"); var $vCount = $("#mainSlider > .imgList > li").length; var $vDuration = 3500; // 자동롤링 주기 (단위 : ms) var $vTimer; var swipeOptions = { // 터치 스와이프 옵션 triggerOnTouchEnd: true, swipeStatus: swipeStatus, allowPageScroll: "vertical", threshold: 0 }; $vElem.swipe(swipeOptions); // 터치스와이프 추가 // 터치스와이프 이벤트 지정 function swipeStatus(event, phase, direction, distance) { $vSize = $vElem.children().width(); if (phase == "move" && (direction == "left" || direction == "right")) { var duration = 0; if (direction == "left") { clearInterval($vTimer); TweenMax.to($vElem, duration, {x:-($vIndex * $vSize) - distance + 'px'}); } else if (direction == "right") { clearInterval($vTimer); TweenMax.to($vElem, duration, {x:-($vIndex * $vSize) + distance + 'px'}); } } else if (phase == "cancel") { visualSlide(); } else if (phase == "end") { if (direction == "right") { if($vIndex===0) { resetTimer(); $vIndex = 0; visualSlide(); return false; } resetTimer(); $vIndex--; visualSlide(); } else if (direction == "left") { if($vIndex===$vCount-1) { $vIndex = $vCount-1; resetTimer(); visualSlide(); return false; } resetTimer(); $vIndex++; visualSlide(); } } } // 메인 비주얼 사이즈 세팅 function visualInit() { var $winWidth = $(window).width(); var $vItem = $vElem.children(); var $initOpt = { 'transform':'matrix(1,0,0,1,' + (-$vIndex * $winWidth) + ', 0)', 'width':$winWidth * $vCount } $vElem.css($initOpt); $vItem.css({'width':$winWidth + 'px'}); } // 페이지네이션 초기화 function pagingInit() { var $item = "
  • "; for(i=0; i<$vCount; i++) { $("#mainSlider > .pagination").append($item); } $("#mainSlider > .pagination > li:first").addClass('on'); } // 페이지네이션 클릭 $(document).on('click', '#mainSlider > .pagination > li', function() { if(!TweenMax.isTweening($vElem)) { var $pIndex = $(this).index(); resetTimer(); $vIndex = $pIndex; visualSlide(); } }); // 메인 비주얼 롤링 처리 function visualSlide() { var $winWidth = $(window).width(); if($vIndex >= $vCount) $vIndex = 0; TweenMax.to($vElem, 0.8, {x:-$vIndex * $winWidth + 'px', ease:Expo.easeOut, delay:0}); $("#mainSlider > .pagination > li").removeClass('on'); $("#mainSlider > .pagination > li").eq($vIndex).addClass('on'); } // 타이머 세팅 $vTimer = setInterval(function() { $vIndex++; visualSlide(); }, $vDuration); // 타이머 리셋 function resetTimer() { $vElem.stop(); clearInterval($vTimer); $vTimer = setInterval(function() { $vIndex++; visualSlide(); }, $vDuration); } visualInit(); pagingInit(); // 윈도우 리사이징 처리 $(window).bind('resize', function() { visualInit(); }); }); // 포토갤러리 추출 커스터마이징 $(function() { var tmpno = $(location).attr('pathname').split('/')[1]; console.log(tmpno);tmpno = ''; var dir = $(".section2 .listWrapper").data('dir'); var page = $(".section2 .listWrapper").data('page'); var elem; var photoAll = $(".section2 .listWrapper .tableArea").html(); var subject = new Array(); // 갤러리 썸네일 제목 배열변수 선언 var content = new Array(); // 갤러리 썸네일 내용 배열변수 선언 var content2 = new Array(); // 갤러리 썸네일 내용 배열변수 선언 var url = new Array(); // 각 썸네일별 링크 저장용 변수 var thumbCount; // 썸네일 개수 (추출개수) var refHeight; // 높이 동기화를 위한 변수 // 포토갤러리 카테고리 가져오기 function getCategory() { if($(".section2 .tableArea li").length > 0) { $("#cate-load").attr('src', tmpno + dir + page); $("#cate-load").load(function() { var title = [], cate_no = [], bo_table = [], cateHTML; $(".section2 .category").remove(); cateHTML = ''; $(".section2 .dropdown").append(cateHTML); $(".section2 .dropdown .category > li:first").addClass('on'); if($(".section2 .tableArea li").length > 0) { /*$(".category > li:first > a").remove(cate_no[i]);*/ //$(".category").find('li:first').html('전체'); }; $("#cate-load").remove(); }); /*$(function(){ $(".category > li:first > a").addClass("test"); });*/ /* $("#cate-load").load('/' + tmpno + '/' + dir + '/' + page + '.php' + ' .cate_select select', function() { var title = [], cate_no = [], cateHTML; $(".section2 .category").remove(); cateHTML = ''; $(".section2 .dropdown").append(cateHTML); $(".section2 .dropdown .category > li:first").addClass('on'); }); */ /* $.ajax({ type: 'GET', url: '/' + tmpno + '/' + dir + '/' + page + '.php', 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) { var title = [], cate_no = [], cateHTML; $(".section2 .category").remove(); cateHTML = ''; $(".section2 .dropdown").append(cateHTML); $(".section2 .dropdown .category > li:first").addClass('on'); }, error:function(xhr,status,error) { console.log(error); } }); */ } } //getCategory(); // 카테고리별 포스팅 추출 함수 function getPhotoPost(cate, bo_table) { var loadURL; // var maxCount = 4; // 카테고리별로 가져올 최대 포스팅 개수 if(cate === null) { loadURL = tmpno + dir + page; } else { //loadURL = tmpno + dir + page + '?&sca=' + cate; loadURL = tmpno + dir + bo_table; } $('.section2_more > a').attr('href', loadURL.replace('nohead=1&','')); $.ajax({ type: 'GET', url: loadURL, contentType: '', beforeSend: function(x) { x.overrideMimeType(''); }, success: function(data) { var temp = $(data).find('.portfolio-list2').html(); $(".section2 .listWrapper .tableArea").html(temp); // $(".section2 .listWrapper .tableArea > table").each(function() { // if($(this).index() > maxCount -1) $(this).remove(); // }); galleryAlign(); elem = $(".section2 .listWrapper .tableArea li"); elem.css('opacity','0'); elem.animate({'opacity':'1'}, 400, function() { elem.css({'opacity':''}); }); }, error:function(xhr,status,error) { console.log(error); } }) } // 카테고리별 포스팅 추출 $(document).on('click', '.section2 .category > li' ,function() { var $cate = $(this).find('a').data('cate'); var $activeText = $(this).find('a').text(); var $bo_table = $(this).find('a').data('bo_table'); // var maxCount = 4; // 카테고리별로 가져올 최대 포스팅 개수 $(".section2 .category > li").removeClass('on'); $(this).addClass('on'); if(!$cate) { $(".section2 .listWrapper .tableArea").css('opacity','0'); $(".section2 .listWrapper .tableArea").html(photoAll); // $(".section2 .listWrapper .tableArea > table").each(function() { // if($(this).index() > maxCount) $(this).remove(); // }); $(".section2 .listWrapper .tableArea").animate({'opacity':'1'}, 400, function() { $(".section2 .listWrapper .tableArea").css({'opacity':''}); }); galleryInit(); } else { getPhotoPost($cate, $bo_table); } $(".section2 .dropdown > a").text($activeText); }); // 최근 갤러리 드롭다운 이벤트 $(".section2 .dropdown").click(function() { if(!$(this).hasClass('open')) { $(this).addClass('open'); $(this).find('.category').css('display','block'); } else { $(this).removeClass('open'); $(this).find('.category').css('display','none'); } }); // 갤러리 초기세팅 function galleryInit() { elem = $(".section2 .listWrapper .tableArea li"); if(elem.length > 0) { thumbCount = elem.length; if($(".hoverBox").length > 0) { $(".hoverBox").parent('a').remove(); } for(i=0; i

    ' + subject[i] + '

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

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

    '); //$(".section2 .listWrapper .tableArea li").eq(i).find('tr').eq(1).css('display','none'); } } } // 카테고리 클릭 후 구조 재정렬 function galleryAlign() { if($(".bbsnewf5").length > 0) { thumbCount = $(".section2 .listWrapper .tableArea .bbsnewf5").length; if($(".hoverBox").length > 0) { $(".hoverBox").parent('a').remove(); } for(i=0; i

    ' + subject[i] + '

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

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

    '); } // 기존에 보여지는 별도 td 의 제목, 내용은 숨김 $(".infoArea").css('display','none'); } } // 테이블 애니메이션 function tableShow() { if($(".section2 .listWrapper").length > 0) { $(".section2 .listWrapper .tableArea li").each(function() { $(this).addClass('scrollreveal'); }); } } galleryInit(); $(".section2 .listWrapper .tableArea li").addClass('scrollreveal'); }); // 공지사항 추출 구조 변경 $(function() { var tmpno = $(location).attr('pathname').split('/')[1]; var $subject = [], $link = [], $date = [], $img = [], $content = []; var $innerHTML = ""; var $wrapper = $(".section4 .postWrapper"); var dir = $(".section4 .postWrapper").data('dir'); var page = $(".section4 .postWrapper").data('page'); var cnt = 0; //$(".section4 tr[class^=board_output_]").each(function() { $(".section4 li").each(function() { $subject[cnt] = $(this).find('a:first').text(); $link[cnt] = $(this).find('a').attr('href'); $date[cnt] = $(this).find('span').text(); //$content[cnt] = $(this).children().eq(-2).find('a').text(); $content[cnt] = $(this).find('div.list_content').text(); $img[cnt] = $(this).find('.board_output_imgs').attr('src'); cnt++; }); $wrapper.html(''); $innerHTML = ''; $wrapper.append($innerHTML); });