var item_width = 131; var item_view = 7; var item_count = 1; var befo_item_count = 1; var item_id = "#price_table .price_area > ul"; var popluarGoods; var popluarIdx = 0; var popluarPlayFlag = true; var PopluarTimer; var saleGoods; var saleIdx = 0; var salePlayFlag = true; var saleTimer; function prevSaleGood() { salePlayFlag = true; fn_playPauseSaleGood(); var hz = 2; if((saleGoods.length % 2) != 0) hz = 1; if(saleIdx != 0){ if (saleIdx > 1) { saleIdx-=2; } drawSaleGood(); }else{ saleIdx = saleGoods.length - hz; drawSaleGood(); } } function nextSaleGood(roll) { if(!roll){ salePlayFlag = true; fn_playPauseSaleGood(); } var hz = 2; if((saleGoods.length % 2) != 0) hz = 1; if(saleIdx != saleGoods.length - hz){ if (saleIdx < saleGoods.length ) { saleIdx+=2; } drawSaleGood(); }else{ saleIdx = 0; drawSaleGood(); } } function drawSaleGood() { var htmlStr = ""; htmlStr +="
"; htmlStr +="
"; htmlStr +="
"; /*=======================첫번째 시작==================================*/ htmlStr +="
"; htmlStr +="

"+saleGoods[saleIdx].entpName+"

"; htmlStr +="
"; htmlStr +=""+saleGoods[saleIdx].goodName+""; htmlStr +=""+$.number(saleGoods[saleIdx].goodPrice)+" 원"; htmlStr +="
"; if (saleGoods[saleIdx].addFileName != null && saleGoods[saleIdx].addFileName != "") { htmlStr +=""+saleGoods[saleIdx].goodName+" 사진"; htmlStr +="\"\""; } else { htmlStr +="사진없음"; htmlStr +="\"사진"; } htmlStr +="
"; htmlStr +="
    "; htmlStr +="
  • 기간 : "; if (saleGoods[saleIdx].goodDcStartDay != null && saleGoods[saleIdx].goodDcStartDay != "" && saleGoods[saleIdx].goodDcEndDay != null && saleGoods[saleIdx].goodDcEndDay != "") { htmlStr +=saleGoods[saleIdx].goodDcStartDay +" ~ "+ saleGoods[saleIdx].goodDcEndDay; } else { htmlStr +="기간정보 없음"; } htmlStr +="
  • "; htmlStr +="
  • "+saleGoods[saleIdx].goodRemarks+"
  • "; htmlStr +="
"; htmlStr +="
"; htmlStr +="
"; /*=======================첫번째 끝==================================*/ /*=======================두번째 시작==================================*/ if (saleIdx < (saleGoods.length-1)) { htmlStr +="
"; htmlStr +="

"+saleGoods[saleIdx+1].entpName+"

"; htmlStr +="
"; htmlStr +=""+saleGoods[saleIdx+1].goodName+""; htmlStr +=""+$.number(saleGoods[saleIdx+1].goodPrice)+" 원"; htmlStr +="
"; if (saleGoods[saleIdx+1].addFileName != null && saleGoods[saleIdx+1].addFileName != "") { htmlStr +=""+saleGoods[saleIdx+1].goodName+" 사진"; htmlStr +="\"\""; } else { htmlStr +="사진없음"; htmlStr +="\"사진"; } htmlStr +="
"; htmlStr +="
    "; htmlStr +="
  • 기간 : "; if (saleGoods[saleIdx+1].goodDcStartDay != null && saleGoods[saleIdx+1].goodDcStartDay != "" && saleGoods[saleIdx+1].goodDcEndDay != null && saleGoods[saleIdx+1].goodDcEndDay != "") { htmlStr +=saleGoods[saleIdx+1].goodDcStartDay +" ~ "+ saleGoods[saleIdx+1].goodDcEndDay; } else { htmlStr +="기간정보 없음"; } htmlStr +="
  • "; htmlStr +="
  • "+saleGoods[saleIdx+1].goodRemarks+"
  • "; htmlStr +="
"; htmlStr +="
"; htmlStr +="
"; } /*=======================두번째 끝==================================*/ htmlStr +="
"; htmlStr +="
"; htmlStr +="
"; $("#saleArea").html(htmlStr); $("#saleArea").load(); var saleCountHtml = ""+((saleIdx+2)/2)+"/"+Math.ceil(saleGoods.length/2)+""; $("#saleCount").html(saleCountHtml); $("#saleCount").load(); //할인정보 클릭 $("#saleArea .product").click(function(){ $("#sendFields").html(makeField("searchCondition06", 1)); $("#sendFields").append(makeField("searchKeyword2", $(this).find("span.name").text())); $("form[name='sendForm']") .attr("action", "/tprice/portal/saleinfo/saleinfo/saleinfoList.do") .submit(); }); } function fn_playPauseSaleGood() { var $obj = $("#sale .sale_btn_Play"); var imgPath = ""; if (salePlayFlag == true) { clearTimeout(saleTimer); salePlayFlag = false; imgPath = $obj.find('img').attr('src').replace('_stop','_play'); $obj.find('img').attr('src',imgPath); $obj.find('img').attr('alt',"할인정보 롤링 재생"); } else { fn_playSaleGood(); salePlayFlag = true; imgPath = $obj.find('img').attr('src').replace('_play','_stop'); $obj.find('img').attr('src',imgPath); $obj.find('img').attr('alt',"할인정보 롤링 정지"); } } function fn_playSaleGood() { saleTimer = setInterval(function() { nextSaleGood(true); },5000); } function fn_playPausePopluarGood() { var imgPath = ""; if (popluarPlayFlag == true) { clearTimeout(PopluarTimer); popluarPlayFlag = false; imgPath = $(".hot_play").find('img').attr('src').replace('_stop','_play'); $(".hot_play").find('img').attr('src',imgPath); $(".hot_play").find('img').attr('alt',"인기상품 가격동향 롤링 재생"); } else { fn_playPopluarGood(); popluarPlayFlag = true; imgPath = $(".hot_play").find('img').attr('src').replace('_play','_stop'); $(".hot_play").find('img').attr('src',imgPath); $(".hot_play").find('img').attr('alt',"인기상품 가격동향 롤링 정지"); } } function fn_playPopluarGood() { PopluarTimer = setInterval(function() { popluarIdx++; if (popluarIdx >= popluarGoods.length) { popluarIdx = 0; } drawPopluarGood(); },5000); } function prevPopluarGood(){ popluarIdx--; if (popluarIdx < 0) { popluarIdx = popluarGoods.length -1; } clearTimeout(PopluarTimer); drawPopluarGood(); //fn_playPopluarGood(); //2016.07.29 수정 : 플래그 설정없이 플레이로 플래그가 꼬임. 앞뒤 이동 시 슬라이드 정지로 고정하여 직관성 증가 popluarPlayFlag = true; fn_playPausePopluarGood(); } function nextPopluarGood() { popluarIdx++; if (popluarIdx >= popluarGoods.length) { popluarIdx = 0; } clearTimeout(PopluarTimer); drawPopluarGood(); //fn_playPopluarGood(); popluarPlayFlag = true; fn_playPausePopluarGood(); } function drawPopluarGood() { var htmlStr = ""; var inspectDate = popluarGoods[popluarIdx].inspectDate; var goodName = popluarGoods[popluarIdx].goodName; var goodAvgPrice = popluarGoods[popluarIdx].goodAvgPrice; var prv1WeekChangeRat = popluarGoods[popluarIdx].prv1weekChangeRat; $('.hot_item .date').text(inspectDate); htmlStr += ""; $(".hot_item .item").html(htmlStr); } /* * 웹접근성 관련 기능 수정전 원본 함수 by 황인환 2018-04-20 */ function ORG_drawPopluarGood() { var htmlStr = ""; var inspectDate = popluarGoods[popluarIdx].inspectDate; var goodName = popluarGoods[popluarIdx].goodName; var goodAvgPrice = popluarGoods[popluarIdx].goodAvgPrice; var prv1WeekChangeRat = popluarGoods[popluarIdx].prv1weekChangeRat; htmlStr += "

\"상품별

"; htmlStr += "
"+inspectDate+" 전주대비
"; htmlStr += "
"; htmlStr += ""; htmlStr += ""; htmlStr += ""; htmlStr += "
"; htmlStr += "
"; htmlStr += ""; htmlStr += "
"; $(".hot_item").html(htmlStr); $(".hot_item").load(); } $(document).ready(function(){ //할인정보, 상품별 가격동향 //2024.04.08 학원링크 동일하게 수정 fn_getEtcInfo(); $("#btn_goeadu").click(function(){ var text = $("#eduarea option:selected").val(); var url =""; if(text =="020100000"){ //서울 url = "https://hakwon.neis.go.kr/nxui/index.html"; } if(text =="020500000"){ //부산 url = "https://hakwon.neis.go.kr/nxui/index.html"; } if(text =="020300000"){ //대구 url = "https://hakwon.neis.go.kr/nxui/index.html"; } if(text =="020400000"){ //대전 url ="https://hakwon.neis.go.kr/nxui/index.html"; } if(text =="020200000"){ //광주 url = "https://hakwon.neis.go.kr/nxui/index.html"; } if(text =="020600000"){ //울산 url = "https://hakwon.neis.go.kr/nxui/index.html"; } if(text =="020700000"){ //인천 url = "https://hakwon.neis.go.kr/nxui/index.html"; } if(text =="020800000"){ //강원 url = "https://hakwon.neis.go.kr/nxui/index.html"; } if(text =="020900000"){ //경기 url = "https://hakwon.neis.go.kr/nxui/index.html"; } if(text =="021000000"){ //경남 url = "https://hakwon.neis.go.kr/nxui/index.html"; } if(text =="021100000"){ //경북 url = "https://hakwon.neis.go.kr/nxui/index.html"; } if(text =="021200000"){ //전남 url = "https://hakwon.neis.go.kr/nxui/index.html"; } if(text =="021300000"){ //전북 url = "https://hakwon.neis.go.kr/nxui/index.html"; } if(text =="021400000"){ //충남 url = "https://hakwon.neis.go.kr/nxui/index.html"; } if(text =="021500000"){ //충북 url = "https://hakwon.neis.go.kr/nxui/index.html"; } if(text =="021600000"){ //제주 url = "https://hakwon.neis.go.kr/nxui/index.html"; } if(text =="021700000"){ //세종 url = "https://hakwon.neis.go.kr/nxui/index.html"; } window.open(url, "_blank"); //window.open("/tprice/portal/servicepriceinfo/educationalprice/educationalPriceList.do", "_self"); 2016.07.28 화면 이동 삭제 }); // 팝업공지 띄우기 var popNoticeFileSeq = $('#popNotice').val(); if(popNoticeFileSeq.length > 0){ var popFile = popNoticeFileSeq.split(','); var forbidPop = ex_getCookie("forbidPop").split(','); for(var x=0 ; x< popFile.length; x++) { var openType = true; for(var y=0 ; y< forbidPop.length; y++) { if(forbidPop[y] == popFile[x]){ openType = false; } } if(openType){ fn_openLayerPopup(popFile[x],x*20); } } } //2016.08.22 수정 : 지도 이미지 삭제 후 판매점정보 링크 이미지 삽입함 // 쿠키저장 지역 세팅 /*var myArea = ex_getCookie("myarea"); if('' != myArea){ $("#areaCode option").each(function(i){ if(myArea == $(this).val() ){ $(this).attr("selected", "selected"); fn_changeAreaMap($(this).val()); } }); // $("#areaCode").click(); } // 지역 변경 $("#areaCode").change(function(){ // 마지막 선택 지역 쿠키에 저장 setCookie("myarea",$('#areaCode').val(),365); // 시/구/군 fn_getCode("AR", $(this).val(), "areaDetailCode", "", "", ""); fn_changeAreaMap($(this).val()); });*/ $('#pop').PopupZone({ prevBtn : '.pop_btn_Prev', nextBtn : '.pop_btn_Next', playBtn : '.pop_btn_Play', waitingTime : '5000' }); $(".table_t1 tbody tr").hover(function() { /* * 상품별 그래프 */ var goodName = $(this).find("input[name='goodName']").val(); var divId = $(this).parent("tbody").parent("table").parent("div").parent("div").parent("div").attr("id"); // 월간 그래프 var monthGId = "#G_"+ divId.substring(3,5) +"c1"; var monthCategories = new Array(); //var monthCategories = ["5개월전","4개월전","3개월전","2개월전","1개월전","현재"]; var monthGoodPriceArr = new Array(); for(var i=5; i>=0; i--){ var tmpPrice = $(this).find("input[name='prv"+i+"MonthAvgPrice']").val(); monthCategories.push($(this).find("input[name='prv"+i+"MonthAvgName']").val()); monthGoodPriceArr.push(tmpPrice != "" ? Number(tmpPrice, 10) : null); } // 그래프 그리기 fn_drawGraph(monthGId, goodName, monthCategories, monthGoodPriceArr); // 연간 그래프 var yearGId = "#G_"+ divId.substring(3,5) +"c2"; var yearCategories = new Array(); var yearGoodPriceArr = new Array(); for(var i=3; i>=0; i--){ var tmpPrice = $(this).find("input[name='prv"+i+"QuarterAvgPrice']").val(); yearCategories.push($(this).find("input[name='prv"+i+"QuarterAvgName']").val()); yearGoodPriceArr.push(tmpPrice != "" ? Number(tmpPrice, 10) : null); } // 그래프 그리기 fn_drawGraph(yearGId, goodName, yearCategories, yearGoodPriceArr); }); //업태별 최저가 품목 팝업 호버 /* * 웹접근성 관련 주석 처리 by 황인환 2020.04.22. $("#up_product ul").hover(function(){ $("div.storeCnt_pop:not(:animated)",this).slideDown("fast"); },function(){ $("div.storeCnt_pop",this).hide(); }); */ // 주간 가격정보 마우스 오버 $(document).on("mouseover", ".price_area", function(){ Rauto = true; price_play(); }).on("mouseout", ".price_area", function(){ Rauto = false; price_play(); }); // 상품 분류코드 $("#itemGroupCodeL2").change(function(){ fn_getItemGroupCode("itemGroupCodeL3", "3", $(this).val(), "", fn_trigger_itemGroupCodeL3, "N"); }); // 하위 품목 변경 $("#itemGroupCodeL3").change(function(){ fn_getGoodCodeList($(this).val(), ""); }); // 내 지역 최저가 매장 검색 $("#btn_search").click(function(){ if($("#sel_goodId").val() == ""){ alert("선택한 상품이 없습니다."); return; } $.ajax({ type:"POST", url: "/tprice/portal/main/getMyAreaPriceInfo.do", data: "goodId=" + $("#sel_goodId").val() + "&areaCode=" + $("#areaCode").val(), dataType:"json", success:function(data){ fn_makeHtml(data); }, failure:function(data){} }); }); price_rolling(1,'',''); //전국가격정보 업체 리스트 팝업 호버 $("#tr_nationPrice .p1").hover(function(){ fn_shwoNationPriceInfo(); },function(){ $("div.nationPrice_pop",this).hide(); }); $('#lowestPrice').focusin(function(){ fn_shwoNationPriceInfo(); }); $('#lowestPrice').focusout(function(){ $("div.nationPrice_pop", $('#tr_nationPrice .p1')).hide(); }); }); function fn_shwoNationPriceInfo() { // 웹접근성 관련 주석 처리 by 황인환 2020.04.22. return false; if($('#tr_nationPrice .p1').find("dt").children().length == 0){ var price = $('#tr_nationPrice .p1').text().trim().replace(/,/g,""); fn_nationPrice_pop($('#tr_nationPrice .p1'), price); } $("div.nationPrice_pop:not(:animated)", $('#tr_nationPrice .p1')).slideDown("fast"); } //할인정보,상품별 가격동향 //2024.04.11 웹인증 명도 수정 완료 이승진 function fn_getEtcInfo() { $.ajax({ type:"POST", url: "/tprice/portal/main/selectEtcInfo.do", dataType:"json", success:function(data){ saleGoods = data.saleInfo; saleIdx = 0; popluarGoods = data.popluarGood; popluarIdx = 0; if (saleGoods.length > 0) { drawSaleGood(); var style = 'vertical-align: middle;border: solid 1px #666666;border-bottom-width: 1px;border-left-width: 1px;margin-left: 5px;'; var innerHtml = ''; fn_playSaleGood(); $("#sale .date").html(saleGoods[0].week + innerHtml); } drawPopluarGood(); fn_playPopluarGood(); popluarPlayFlag = true; }, failure:function(data){} }); } function fn_changeAreaMap(areaCode){ var imgPath = $(".map img").attr("src"); var index = imgPath.indexOf("_", 33); if(areaCode == "020100000"){ // 서울특별시 $(".map img").attr("src", imgPath.substring(0, index+1) + "01" + imgPath.substring(39)); $(".map img").attr("alt", "서울특별시"); $(".map img").attr("title", "서울특별시"); } else if(areaCode == "020500000"){ // 부산광역시 $(".map img").attr("src", imgPath.substring(0, index+1) + "02" + imgPath.substring(39)); $(".map img").attr("alt", "부산광역시"); $(".map img").attr("title", "부산광역시"); } else if(areaCode == "020300000"){ // 대구광역시 $(".map img").attr("src", imgPath.substring(0, index+1) + "03" + imgPath.substring(39)); $(".map img").attr("alt", "대구광역시"); $(".map img").attr("title", "대구광역시"); } else if(areaCode == "020700000"){ // 인천광역시 $(".map img").attr("src", imgPath.substring(0, index+1) + "04" + imgPath.substring(39)); $(".map img").attr("alt", "인천광역시"); $(".map img").attr("title", "인천광역시"); } else if(areaCode == "020200000"){ // 광주광역시 $(".map img").attr("src", imgPath.substring(0, index+1) + "05" + imgPath.substring(39)); $(".map img").attr("alt", "광주광역시"); $(".map img").attr("title", "광주광역시"); } else if(areaCode == "020400000"){ // 대전광역시 $(".map img").attr("src", imgPath.substring(0, index+1) + "06" + imgPath.substring(39)); $(".map img").attr("alt", "대전광역시"); $(".map img").attr("title", "대전광역시"); } else if(areaCode == "020600000"){ // 울산광역시 $(".map img").attr("src", imgPath.substring(0, index+1) + "07" + imgPath.substring(39)); $(".map img").attr("alt", "울산광역시"); $(".map img").attr("title", "울산광역시"); } else if(areaCode == "021700000"){ // 세종특별자치시 $(".map img").attr("src", imgPath.substring(0, index+1) + "08" + imgPath.substring(39)); $(".map img").attr("alt", "세종특별자치시"); $(".map img").attr("title", "세종특별자치시"); } else if(areaCode == "020900000"){ // 경기도 $(".map img").attr("src", imgPath.substring(0, index+1) + "09" + imgPath.substring(39)); $(".map img").attr("alt", "경기도"); $(".map img").attr("title", "경기도"); } else if(areaCode == "020800000"){ // 강원도 $(".map img").attr("src", imgPath.substring(0, index+1) + "10" + imgPath.substring(39)); $(".map img").attr("alt", "강원도"); $(".map img").attr("title", "강원도"); } else if(areaCode == "021500000"){ // 충청북도 $(".map img").attr("src", imgPath.substring(0, index+1) + "11" + imgPath.substring(39)); $(".map img").attr("alt", "충청북도"); $(".map img").attr("title", "충청북도"); } else if(areaCode == "021400000"){ // 충청남도 $(".map img").attr("src", imgPath.substring(0, index+1) + "12" + imgPath.substring(39)); $(".map img").attr("alt", "충청남도"); $(".map img").attr("title", "충청남도"); } else if(areaCode == "021300000"){ // 전라북도 $(".map img").attr("src", imgPath.substring(0, index+1) + "13" + imgPath.substring(39)); $(".map img").attr("alt", "전라북도"); $(".map img").attr("title", "전라북도"); } else if(areaCode == "021200000"){ // 전라남도 $(".map img").attr("src", imgPath.substring(0, index+1) + "14" + imgPath.substring(39)); $(".map img").attr("alt", "전라남도"); $(".map img").attr("title", "전라남도"); } else if(areaCode == "021100000"){ // 경상북도 $(".map img").attr("src", imgPath.substring(0, index+1) + "15" + imgPath.substring(39)); $(".map img").attr("alt", "경상북도"); $(".map img").attr("title", "경상북도"); } else if(areaCode == "021000000"){ // 경상남도 $(".map img").attr("src", imgPath.substring(0, index+1) + "16" + imgPath.substring(39)); $(".map img").attr("alt", "경상남도"); $(".map img").attr("title", "경상남도"); } else if(areaCode == "021600000"){ // 제주특별자치도 $(".map img").attr("src", imgPath.substring(0, index+1) + "17" + imgPath.substring(39)); $(".map img").attr("alt", "제주특별자치도"); $(".map img").attr("title", "제주특별자치도"); } } function fn_onNoticPop(){ } //팝업공지 3일 비활성 function fn_forbidPopup(id){ var forbidPopV = ex_getCookie("forbidPop"); var forbidPop = ex_getCookie("forbidPop").split(','); var state = true; for(var x = 0 ; x > forbidPop.length; x++){ if(id == forvidPop[x]){ state = false; } } if(state){ setCookie("forbidPop",forbidPopV+id+',',3); } $('#popLayer_'+id).hide(); } // 팝업공지 활성화 function fn_openLayerPopup(id, idx){ var top = (50+idx)+"px"; var left = (Math.max(0, (($(window).width() - 1000) / 2) + $(window).scrollLeft()) + idx) + "px"; var htmlV = '
'+ '
공지
'+ '
3일동안 이 팝업을 띄우지 않습니다   '+ '
'+ '
'; $(htmlV).appendTo("#popLayer"); } // 내 지역 최저가 html 생성 function fn_makeHtml(data){ var myAreaInfo = data.myAreaInfo; var minPriceEntp = data.myAreaPrice; var nationPrice = data.myAreaNationPrice; if (myAreaInfo == null) { alert("조회하신 상품의 가격정보가 없습니다."); return; } // 평균가 $("#sp_myAreaAvgPrice").html("" + myAreaInfo.areaCodeName + "평균가" + $.number(myAreaInfo.avgGoodPrice) + "원"); // 상품 이미지 if($.trim(myAreaInfo.fileRgtnSeq) != ""){ $("#div_goodImg").html("" + myAreaInfo.goodName+" 사진"); } else{ $("#div_goodImg").html("사진 없음"); } // 상품명 $("#h3_goodName").text(myAreaInfo.goodName); // 전국 가격 정보 $("#tr_nationPrice .p1").html($.number(nationPrice.minGoodPrice) + ''); $("#tr_nationPrice .p2").html($.number(nationPrice.maxGoodPrice) + ''); $("#tr_nationPrice .p3").html($.number(nationPrice.diffGoodPrice)); $("#tr_nationPrice .p4").html($.number(nationPrice.avgGoodPrice)); $("#myAreaNationPriceSeq").val(nationPrice.inspectSeq); $("#myAreaNationPriceGoodId").val(nationPrice.goodId); // 최저가 매장 var strHtml = ""; for(var i=0; i" + $.number(minPriceEntp[i].goodPrice) + " 원(" + minPriceEntp[i].entpName + ")"; } $("#ol_minPriceEntp").html(strHtml); } $(function(){ $("#price_table .ctrl .prev").click(function() { tab_prev(); }); $("#price_table .ctrl .next").click(function() { tab_next(); }); }); function tab_prev(){ if(item_count > 1){ item_count = item_count -1; if(item_count >= item_view){ z = item_count - item_view+1; } else{ z = item_count; } $(item_id + ">li:nth-child("+z+")").show(); priceOn(1,item_count); } } function tab_next(){ var item_total = $('#price_area > ul > li').length; //주간가격정보 탭 개수 if(item_count < item_total){ item_count = item_count +1; if(item_count > item_view){ x = item_count - item_view; $(item_id + ">li:nth-child("+x+")").hide(); } priceOn(1,item_count); } } // 주간 가격정보 탭 변경 function priceOn(Pid,a) { var item_total = $('#price_area > ul > li').length; //주간가격정보 탭 개수 for (var i=1; i<=item_total; i++) { if(i=0; i--){ //var tmpPrice = $(Rid+ " .table_t1 tbody tr:nth-child("+(nowNum+1)+")").find("#prv"+i+"MonthAvgPrice").val(); var tmpPrice = $(Rid+ " .table_t1 tbody tr:nth-child("+(nowNum+1)+")").find("input[name='prv"+i+"MonthAvgPrice']").val(); //monthCategories.push($(Rid+ " .table_t1 tbody tr:nth-child("+(nowNum+1)+")").find("#prv"+i+"MonthAvgName").val()); monthCategories.push($(Rid+ " .table_t1 tbody tr:nth-child("+(nowNum+1)+")").find("input[name='prv"+i+"MonthAvgName']").val()); monthGoodPriceArr.push(tmpPrice != "" ? Number(tmpPrice, 10) : null); monthData += " "; monthData += $(Rid+ " .table_t1 tbody tr:nth-child("+(nowNum+1)+")").find("input[name='prv"+i+"MonthAvgName']").val(); monthData += " "; monthData += (tmpPrice != "" ? Number(tmpPrice, 10)+"원" : "정보없음"); } // console.log("rowID is ["+(nowNum+1)+"]"); $("#monthGraphData_"+((nowNum+1))).html(monthData); // 그래프 그리기 fn_drawGraph(monthGId, goodName, monthCategories, monthGoodPriceArr); // 연간 그래프 var yearGId = "#G_"+ar+"c2"; var yearCategories = new Array(); var yearGoodPriceArr = new Array(); for(var i=3; i>=0; i--){ //var tmpPrice = $(Rid+ " .table_t1 tbody tr:nth-child("+(nowNum+1)+")").find("#prv"+i+"QuarterAvgPrice").val(); var tmpPrice = $(Rid+ " .table_t1 tbody tr:nth-child("+(nowNum+1)+")").find("input[name='prv"+i+"QuarterAvgPrice']").val(); //yearCategories.push($(Rid+ " .table_t1 tbody tr:nth-child("+(nowNum+1)+")").find("#prv"+i+"QuarterAvgName").val()); yearCategories.push($(Rid+ " .table_t1 tbody tr:nth-child("+(nowNum+1)+")").find("input[name='prv"+i+"QuarterAvgName']").val()); yearGoodPriceArr.push(tmpPrice != "" ? Number(tmpPrice, 10) : null); yearData += " "; yearData += $(Rid+ " .table_t1 tbody tr:nth-child("+(nowNum+1)+")").find("input[name='prv"+i+"QuarterAvgName']").val(); yearData += " "; yearData += (tmpPrice != "" ? Number(tmpPrice, 10)+"원" : "정보없음"); } $("#yearGraphData_"+((nowNum+1))).html(yearData); // 그래프 그리기 fn_drawGraph(yearGId, goodName, yearCategories, yearGoodPriceArr); } var item_total = $('#price_area > ul > li').length; //주간가격정보 탭 개수 if(nowNum == Rcnt){ b = a+1; // 다음 품목 if (b>item_total){ b=1; priceOn(1,1); for (var i=1;i<=7;i++) { $(item_id + ">li:nth-child("+i+")").show(); } } else {tab_next();} } } function price_prev_rolling(id,a,idx) { if(idx) {nowNum = idx;} if(a) {ar=a;} else{a = ar;} var Rid = "#P"+id+"c"+ar; var Rcnt = $(Rid+" .table_t1 tbody tr").size(); if( nowNum > 0 ){ //라인수 많은면 $(Rid+ " .table_t1 tbody tr:nth-child("+nowNum+")").show(); $(Rid+ " .table_t1 tbody tr:nth-child("+(nowNum+1)+")").removeClass('on'); $(Rid+ " .table_t1 tbody tr:nth-child("+nowNum+")").addClass('on'); } else{ if(ar > 1){ // 첫번째 탭 이전이면 tab_prev(); Rid = "#P"+id+"c"+ar; Rcnt = $(Rid+" .table_t1 tbody tr").size(); nowNum = Rcnt; $(Rid+ " .table_t1 tbody tr").removeClass('on'); $(Rid+ " .table_t1 tbody tr:nth-child("+nowNum+")").addClass('on'); if(Rcnt > Rview){ for (var i=1;i<=(Rcnt-Rview);i++) { $(Rid+ " .table_t1 tbody tr:nth-child("+i+")").hide(); } } } } nowNum = nowNum - 1; } $(function(){ $("#price_table .table_ctrl button").click(function() { if( $(this).hasClass('prev') ) { price_prev_rolling(1,'',''); } else if( $(this).hasClass('next') ) { price_rolling(1,'',''); } else { price_play(); } }); }); function price_play(){ if(Rauto) { Rauto = false; var Rauto_img = $('#price_table .table_ctrl button.stop').find('img')[0]; Rauto_img.src = Rauto_img.src.replace('_stop','_play'); Rauto_img.attr = Rauto_img.attr; $('#price_table .table_ctrl button.stop').find('img').attr('alt',"가격 정보 재생"); } else{ Rauto = true; var Rauto_img = $('#price_table .table_ctrl button.stop').find('img')[0]; Rauto_img.src = Rauto_img.src.replace('_play','_stop'); $('#price_table .table_ctrl button.stop').find('img').attr('alt',"가격 정보 정지"); } return false; } $(function(){ setInterval(function() { if(Rauto){ price_rolling(1,'',''); } },5000); }); // 그래프 월간, 년간 변경 function G_On(G_id,a) { for (var i=1;i<=10;i++) { if(i<10){inn="0"+i;} else {inn=""+i;} G_Menu = document.getElementById("G_"+G_id+"m"+i); G_Content = document.getElementById("G_"+G_id+"c"+i); G_More = document.getElementById("G_"+G_id+"more"+i); if (G_Menu) { if (G_Menu.tagName=="IMG") { G_Menu.src = G_Menu.src.replace("_on.", "_off."); } if (G_Menu.tagName=="A") { G_Menu.className=""; } if (G_Menu.tagName=="LI") { G_Menu.className=""; } } if (G_Content) { G_Content.style.display="none"; } if (G_More) { G_More.style.display="none"; } } if(a<10){ann="0"+a;} else {ann=""+a;} G_Menu = document.getElementById("G_"+G_id+"m"+a); G_Content = document.getElementById("G_"+G_id+"c"+a); G_More = document.getElementById("G_"+G_id+"more"+a); if (G_Menu) { if (G_Menu.tagName=="IMG") { G_Menu.src = G_Menu.src.replace("_off.", "_on."); } if (G_Menu.tagName=="A") { G_Menu.className="on"; } if (G_Menu.tagName=="LI") { G_Menu.className="on"; } } if (G_Content) { G_Content.style.display="block"; } if (G_More) { G_More.style.display="block"; } } //품목별 등락률 롤링 $(function() { var $P_Idx = 1; var $P_width =105; var $P_view =7; var $P_Size = $('#fluctuate ul.list li').size(); var $P_pst = 0; $('#fluctuate .ctrl .prev').click(function() { if( $P_Idx > 1 ) { $P_pst = $P_pst + $P_width; $('#fluctuate ul.list').animate( { left : $P_pst }, 500); $P_Idx--; } else { //alert('처음입니다.'); } }); $('#fluctuate .ctrl .next').click(function() { if( $P_Idx <= $P_Size-$P_view ) { $P_pst = -$P_width * $P_Idx; $('#fluctuate ul.list ').animate( { left : $P_pst }, 500); $P_Idx++; } else { //alert('마지막입니다.'); } }); }); //인기상품 가격동향 /* $(function() { var $Hot_Idx = 1; var $Hot_width =60; var $Hot_view =1; var $Hot_Size = $('.hot_item ul.list li').size(); var $Hot_pst = 0; $('.hot_item .ctrl .prev').click(function() { if( $Hot_Idx > 1 ) { $Hot_pst = $Hot_pst + $Hot_width; $('.hot_item .list').animate( { top : $Hot_pst }, 500); $Hot_Idx--; } else { //alert('처음입니다.'); } }); $('.hot_item .ctrl .next').click(function() { if( $Hot_Idx <= $Hot_Size-$Hot_view ) { $Hot_pst = -$Hot_width * $Hot_Idx; $('.hot_item .list').animate( { top : $Hot_pst }, 500); $Hot_Idx++; } else { //alert('마지막입니다.'); } }); }); */ //popupzone (function($){ $.fn.PopupZone = function(options) { var settings = { prevBtn : '', nextBtn : '', playBtn : '', waitingTime : '' }; $.extend(settings, options); settings.areaDiv = this; settings.prevBtn = $(settings.prevBtn); settings.nextBtn = $(settings.nextBtn); settings.playBtn = $(settings.playBtn); settings.cnt = settings.areaDiv.find('li').length; settings.waitingTime = parseInt(settings.waitingTime); settings.nowNum = 0; settings.moveFlag = true; settings.moveType; settings.setTimeOut; var status=true; function emptySetting() { settings.areaDiv.find('.count').html(settings.nowNum+1); settings.areaDiv.find('li').hide(); } function setRolling(aniFlag) { if(!settings.moveFlag){ if(settings.moveType=="next" || settings.moveType == null){ settings.nowNum++; if(settings.nowNum == settings.cnt) settings.nowNum = 0; } else if(settings.moveType=="prev") { settings.nowNum--; if(settings.nowNum < 0) settings.nowNum = (settings.cnt-1); } } emptySetting(); if( settings.cnt < 2 ) { aniFlag = true; } if(aniFlag) settings.areaDiv.find('li').eq(settings.nowNum).show(); else settings.areaDiv.find('li').eq(settings.nowNum).fadeIn('normal'); // 기본 : aniFlag 설정 없으면 fade 효과 - 조정 aniFlag = false; settings.moveFlag = false; if(status){ if( settings.cnt > 1 ) { settings.setTimeOut= setTimeout(setRolling , settings.waitingTime); } } } function playRolling(){ if(status){ clearTimeout(settings.setTimeOut); settings.playBtn.find('img').attr('src',"/tprice/images/portal/main/popup_btn_play.gif"); settings.playBtn.find('img').attr('alt',"팝업 롤링 재생"); status = false; }else{ settings.playBtn.find('img').attr('src',"/tprice/images/portal/main/popup_btn_stop.gif"); settings.playBtn.find('img').attr('alt',"팝업 롤링 정지"); status = true; setRolling(); } return false; } function prevRolling(){ clearTimeout(settings.setTimeOut); settings.moveType = "prev"; setRolling(); return false; } function nextRolling() { clearTimeout(settings.setTimeOut); settings.moveType = "next"; setRolling(); return false; } setRolling(); settings.prevBtn.click(prevRolling); settings.nextBtn.click(nextRolling); settings.playBtn.click(playRolling); }; })(jQuery); //공공요금 롤링 $(function() { var $PB_Idx = 1; var $PB_width =220; var $PB_view =1; var $PB_Size = $('#outside_prcie1 .item_area .item').size(); var $PB_pst = 0; $('#outside_prcie1 .ctrl .prev').click(function() { var $list = $('#outside_prcie1 .item_area'); var $li = $('#outside_prcie1 .item_area .item'); $li.slice($PB_Size-1,$PB_Size).prependTo('#outside_prcie1 .item_area'); $li.removeClass("left"); $li.removeClass("right"); $li.removeClass("on"); $('#outside_prcie1 .item_area .item:nth-child(1)').addClass('left'); $('#outside_prcie1 .item_area .item:nth-child(2)').addClass('on'); $('#outside_prcie1 .item_area .item:nth-child(3)').addClass('right'); }); $('#outside_prcie1 .ctrl .next').click(function() { var $list = $('#outside_prcie1 .item_area'); var $li = $('#outside_prcie1 .item_area .item'); $li.slice(0,1).appendTo('#outside_prcie1 .item_area'); $li.removeClass("left"); $li.removeClass("right"); $li.removeClass("on"); $('#outside_prcie1 .item_area .item:nth-child(1)').addClass('left'); $('#outside_prcie1 .item_area .item:nth-child(2)').addClass('on'); $('#outside_prcie1 .item_area .item:nth-child(3)').addClass('right'); }); }); //개인서비스요금 롤링 $(function() { var $PB_Size = $('#outside_prcie5 .item_area .item').size(); $('#outside_prcie5 .ctrl .prev').click(function() { var $li = $("#outside_prcie5 .item_area .item"); $li.slice($PB_Size-1,$PB_Size).prependTo('#outside_prcie5 .item_area'); $li.removeClass("left"); $li.removeClass("right"); $li.removeClass("on"); $('#outside_prcie5 .item_area .item:nth-child(1)').addClass('left'); $('#outside_prcie5 .item_area .item:nth-child(2)').addClass('on'); $('#outside_prcie5 .item_area .item:nth-child(3)').addClass('right'); }); $('#outside_prcie5 .ctrl .next').click(function() { var $li = $("#outside_prcie5 .item_area .item"); $li.slice(0,1).appendTo('#outside_prcie5 .item_area'); $li.removeClass("left"); $li.removeClass("right"); $li.removeClass("on"); $('#outside_prcie5 .item_area .item:nth-child(1)').addClass('left'); $('#outside_prcie5 .item_area .item:nth-child(2)').addClass('on'); $('#outside_prcie5 .item_area .item:nth-child(3)').addClass('right'); }); }); //약가정보 롤링 $(function() { var $H_Idx = 1; var $H_width =235; var $H_view =1; var $H_Size = $('#outside_prcie3 .item_area .item').size(); var $H_pst = 0; $('#outside_prcie3 .ctrl .prev').click(function() { if( $H_Idx > 1 ) { $H_pst = $H_pst + $H_width; $('#outside_prcie3 .item_area').animate( { left : $H_pst }, 500); $H_Idx--; } else { //alert('처음입니다.'); } }); $('#outside_prcie3 .ctrl .next').click(function() { if( $H_Idx <= $H_Size-$H_view ) { $H_pst = -$H_width * $H_Idx; $('#outside_prcie3 .item_area').animate( { left : $H_pst }, 500); $H_Idx++; } else { //alert('마지막입니다.'); } }); }); jQuery(function($){ $("#test .ctrl a").click(function(){ alert('a'); var $UlPosition = $(this).parent().siblings(".icon_list").children(".icon_ul").css("top"); //ul의 top: 값을 변수에 담았습니다 ! alert($UlPosition); //alert 창으로 띄웠더니 0px이 떠요 ㅠㅠ if($UlPosition <= 0){ $(this).parent().siblings(".icon_list").children(".icon_ul").animate( { top : "-=63px" }, 1000); }else{ return false; }; }); $(".ctrl_btn .prev").click(function(){ $(this).parent().siblings(".icon_list").children(".icon_ul").animate( { top : "+=63px" }, 1000); }); }); // 그래프 function fn_drawGraph(tgtObj, goodName, categories, goodPriceArr){ $(tgtObj).highcharts({ credits: { text:"", href:"" }, tooltip: { enabled : false }, title: { text: "", //x: -20 //center }, xAxis: { categories: categories }, yAxis: { floor: 0, //alternateGridColor: '#FDFFD5', labels: { format: '{value}' }, title: { text: '' }, plotLines: [{ value: 1, width: 2, color: '#808080' }] }, series: [{ name: goodName, data: goodPriceArr }], navigation: { buttonOptions: { enabled: false } } }); // 웹접근성 가격동향 텍스트 정보 if(goodName != undefined){ var tagType = $(tgtObj).attr("id").substr(3,4); var gType = tagType == "c1"? "월간":"연간"; var noneDisplayObj = $('#noneDisplay'+tagType); noneDisplayObj.html(''); var inTable = $('
'); $(''+goodName+' '+gType+' 가격정보 그래프').appendTo(inTable); $('기간가격').appendTo(inTable); for(var i = 0; i < categories.length; i++){ var catgori = categories[i] != null? categories[i] : ""; var goodPrice = goodPriceArr[i] != null? goodPriceArr[i]+"원": ""; $(''+catgori+''+goodPrice+'').appendTo(inTable); } inTable.appendTo(noneDisplayObj); } } //품목별 상품 조회 function fn_getGoodCodeList(goodSmlclsCode, selVal){ $("#sel_goodId option").each(function(){ $(this).remove(); }); $.ajax({ type:"POST", url: "/tprice/portal/dailynecessitypriceinfo/priceiteminfo/getGoodCodeList.do", data: "goodSmlclsCode="+goodSmlclsCode, dataType:"json", success:function(data){ var codeData = data.json; $.each(codeData, function(i){ if(codeData[i].CODE == selVal){ $("#sel_goodId").append(""); } else{ $("#sel_goodId").append(""); } }); }, failure:function(data){} }); } function fn_moveWeekPriceTab() { if (befo_item_count > item_count) { if(item_count > 1){ item_count = item_count -1; if(item_count >= item_view){ z = item_count - item_view+1; } else{ z = item_count; } $(item_id + ">li:nth-child("+z+")").show(); } } else { if(item_count > item_view){ x = item_count - item_view; $(item_id + ">li:nth-child("+x+")").hide(); } } } function fn_trigger_itemGroupCodeL3(){ $("#itemGroupCodeL3").trigger("change"); } //전국가격정보 업체 리스트 팝업 function fn_nationPrice_pop(obj, price){ var params = {}; params.goodPrice = price; params.inspectSeq = $("#myAreaNationPriceSeq").val(); params.goodId = $("#myAreaNationPriceGoodId").val(); $.ajax({ type:"POST", url: "/tprice/portal/main/getNationPriceEntp.do", data: params, dataType:"json", success:function(data){ var result = data.myAreaNationPriceEntp; var innerStr = ""; $.each(result, function(i){ innerStr += '
'; innerStr += result[i].entpName; innerStr += '
'; }); $(obj).find("dt").html(innerStr); }, failure:function(data){} }); }