var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{ let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opens = _____WB$wombat$assign$function_____("opens"); /** * 상품상세 섬네일 롤링 */ $(document).ready(function(){ $.fn.prdImg = function(parm){ var index = 0; var target = parm.target; var view = parm.view; var listWrap = target.find('.xans-product-addimage'); var limit = listWrap.find('> ul > li').length; var ul = target.find('.xans-product-addimage > ul'); var liFirst = target.find('.xans-product-addimage > ul > li:first-child'); var liWidth = parseInt(liFirst.width()); var liHeight = parseInt(liFirst.height()); var blockWidth = liWidth + parseInt(liFirst.css('marginRight')) + parseInt(liFirst.css('marginLeft')); var columWidth = blockWidth * view; var colum = Math.ceil(limit / view); var roll = { init : function(){ function struct(){ var ulWidth = limit * parseInt(blockWidth); listWrap.append(''); listWrap.append(''); ul.css({'position':'absolute', 'left':0, 'top':0, 'width':ulWidth}); listWrap.find('> ul > li').each(function(){ $(this).css({'float':'left'}); }); listWrap.css({'position':'relative', 'height':liHeight}); var prev = listWrap.find('.prev'); var next = listWrap.find('.next'); prev.click(function(){ if(index > 0){ index --; } roll.slide(index); }); next.click(function(){ if(index < (colum-1) ){ index ++; } roll.slide(index); }); if(index == 0){ prev.hide(); } else { prev.show(); } if(index >= (colum-1)){ next.hide(); } else { next.show(); } } if(limit > view){ struct(); } }, slide : function(index){ var left = '-' + (index * columWidth) +'px'; var prev = listWrap.find('.prev'); var next = listWrap.find('.next'); if(index == 0){ prev.hide(); } else { prev.show(); } if(index >= (colum-1)){ next.hide(); } else { next.show(); } ul.stop().animate({'left':left},500); } } roll.init(); }; // 함수호출 : 상품상세 페이지 $.fn.prdImg({ target : $('.xans-product-image'), view : 5 }); // 함수호출 : 상품확대보기팝업 $.fn.prdImg({ target : $('.xans-product-zoom'), view : 5 }); }); /** * 상품상세 사용후기 */ $(document).ready(function(){ $('.xans-product-review a').click(function(e) { e.preventDefault(); var no = $(this).attr('href').replace(/(\S*)no=(\d+)(\S*)/g, '$2'); var $obj = $('#product-review-read_'+no); //로드된 엘리먼트 존재 체크 if ($obj.length > 0) { if ($obj.css('display') =='none') { $obj.show(); } else { $obj.hide(); } return; } REVIEW.getReadData($(this)); }); }); var PARENT = ''; var OPEN_REVIEW = ''; var REVIEW = { getReadData : function(obj, eType) { if (obj != undefined) { PARENT = obj; var sHref = obj.attr('href'); var pNode = obj.parents('tr'); var pass_check = '&pass_check=F'; } else { var sHref = PARENT.attr('href'); var pNode = PARENT.parents('tr'); var pass_check = '&pass_check=T'; } var sQuery = sHref.split('?'); var sQueryNo = sQuery[1].split('='); if (OPEN_REVIEW == sQueryNo[1]) { $('#product-review-read').remove(); OPEN_REVIEW = ''; return false; } else { OPEN_REVIEW = sQueryNo[1]; } $.ajax({ url : '/exec/front/board/product/4?'+sQuery[1]+pass_check, dataType: 'json', success: function(data) { $('#product-review-read').remove(); var sPath = document.location.pathname; var sPattern = /^\/product\/(.+)\/([0-9]+)(\/.*)/; var aMatchResult = sPath.match(sPattern); if (aMatchResult) { var iProductNo = aMatchResult[2]; } else { var iProductNo = getQueryString('product_no'); } var aHtml = []; //읽기 권한 체크 if (false === data.read_auth && eType == undefined) { alert(decodeURIComponent(data.alertMSG)); return false; } if (data.is_secret == true) { // 비밀글 비밀번호 입력 폼 aHtml.push('
'); } else { // 글 내용 if (data.read['content_image'] != null) { var sImg = data.read['content_image']; } else { var sImg = ''; } aHtml.push(''); // 댓글리스트 if (data.comment != undefined && data.comment.length != undefined) { aHtml.push('
');
if (data.comment[i]['comment_reply_display'] == true) {
aHtml.push('');
}
aHtml.push(''+data.comment[i]['comment_content']+'
'); aHtml.push(''+data.comment[i]['comment_content']+'
'); aHtml.push('
');
if (data.comment[i]['comment_reply_display'] == true) {
aHtml.push('');
}
aHtml.push(''+data.comment[i]['comment_content']+'
'); aHtml.push(''+data.comment[i]['comment_content']+'
'); aHtml.push('