PageSourceSearch

https://looknone.co.kr/ind-script/optimizer_user.php?filename=K05J…5cac3b591e84737b34efac9&t=1767313950&user=T

js looknone.co.kr collected 2026-09-26 11:30:59 UTC 20,210 bytes, 601 lines download raw bytes

1 /**
2 * 모바일쇼핑몰 슬라이딩메뉴 */
3var aCategory = [];
4$(function(){
5    var methods = {
6        aCategory    : [],
7        aSubCategory : {},
8        get: function()
9        {
10             $.ajax({
11                url : '/exec/front/Product/SubCategory',
12                dataType: 'json',
13                success: function(aData) {
14                    if (aData == null || aData == 'undefined') {
15                        methods.checkSub();
16                        return;
17                    }
18                    for (var i=0; i<aData.length; i++)
19                    {
20                        var sParentCateNo = aData[i].parent_cate_no;
21                        var sCateNo = aData[i].cate_no;
22                        if (!methods.aSubCategory[sParentCateNo]) {
23                            methods.aSubCategory[sParentCateNo] = [];
24                        }
25                        if (!aCategory[sCateNo]) {
26                            aCategory[sCateNo] = [];
27                        }
28                        methods.aSubCategory[sParentCateNo].push( aData[i] );
29                        aCategory[sCateNo] = aData[i];
30                    }
31                    methods.checkSub();
32                    methods.getMyCateList();
33                }
34            });
35        },
36        getParam: function(sUrl, sKey) {
37            if (typeof sUrl !== 'string') return;
38            var aUrl         = sUrl.split('?');
39            var sQueryString = aUrl[1];
40            var aParam       = {};
41            if (sQueryString) {
42                var aFields = sQueryString.split("&");
43                var aField  = [];
44                for (var i=0; i<aFields.length; i++) {
45                    aField = aFields[i].split('=');
46                    aParam[aField[0]] = aField[1];
47                }
48            }
49            return sKey ? aParam[sKey] : aParam;
50        },
51
52        show: function(overNode, iCateNo) {
53             var oParentNode = overNode;
54            var aHtml = [];
55            var sMyCateList = localStorage.getItem("myCateList");
56            if (methods.aSubCategory[iCateNo] != undefined) {				
57                aHtml.push('<ul class="slideSubMenu">');
58                $(methods.aSubCategory[iCateNo]).each(function() {
59                    var sNextParentNo = this.cate_no;
60                    var sCateSelected = (checkInArray(sMyCateList, this.cate_no) == true) ? ' selected' : '';
61                    if (methods.aSubCategory[sNextParentNo] == undefined) {
62                        aHtml.push('<li class="noChild" id="cate'+this.cate_no+'">');
63                        var sHref = '/product/list_thumb.html'+this.param;
64                    } else {
65                        aHtml.push('<li id="cate'+this.cate_no+'">');
66                        var sHref =  '/product/list_thumb.html'+this.param;
67                    }
68                    aHtml.push('<a href="'+sHref+'" class="cate" cate="'+this.param+'" onclick="subMenuEvent(this);">'+this.name+'</a>');
69                    if (methods.aSubCategory[sNextParentNo] != undefined) {
70                        aHtml.push('<ul>');
71                        $(methods.aSubCategory[sNextParentNo]).each(function() {
72                            var sNextParentNo2 = this.cate_no;
73                            var sCateSelected = (checkInArray(sMyCateList, this.cate_no) == true) ? ' selected' : '';
74                            if (methods.aSubCategory[sNextParentNo2] == undefined) {
75                                aHtml.push('<li class="noChild" id="cate'+this.cate_no+'">');
76                                var sHref = '/product/list_thumb.html'+this.param;
77                            } else {
78                                aHtml.push('<li id="cate'+this.cate_no+'">');
79                                var sHref = '#none';
80                            }
81                            aHtml.push('<a href="'+sHref+'" class="cate" cate="'+this.param+'" onclick="subMenuEvent(this);">'+this.name+'</a>');
82                            if (methods.aSubCategory[sNextParentNo2] != undefined) {
83                                aHtml.push('<ul>');
84
85                                $(methods.aSubCategory[sNextParentNo2]).each(function() {
86                                    aHtml.push('<li class="noChild" id="cate'+this.cate_no+'">');
87                                    var sCateSelected = (checkInArray(sMyCateList, this.cate_no) == true) ? ' selected' : '';
88                                    aHtml.push('<a href="/product/list_thumb.html'+this.param+'" class="cate" cate="'+this.param+'" onclick="subMenuEvent(this);">'+this.name+'</a>');
89                                    
90                                    aHtml.push('</li>');
91                                });
92                                aHtml.push('</ul>');
93                            }
94                            aHtml.push('</li>');
95                        });
96                        aHtml.push('</ul>');
97                    }
98                    aHtml.push('</li>');
99                });
100                aHtml.push('</ul>');
101            }
102            $(oParentNode).append(aHtml.join(''));
103        },
104        close: function() {
105          //  $('.slideSubMenu').remove();
106        },
107        checkSub: function() {
108            $('.cate').each(function(){
109                var sParam = $(this).attr('cate');
110                if (!sParam) return;
111                var iCateNo = Number(methods.getParam(sParam, 'cate_no'));
112                var result = methods.aSubCategory[iCateNo];
113                if (result == undefined) {
114                    if ($(this).closest('#slideProjectList').length) {
115                        var sHref = '/product/project.html'+sParam;
116                    } else {
117                        var sHref = '/product/list_thumb.html'+sParam;
118                    }
119
120                    $(this).attr('href', sHref);
121                    $(this).parent().attr('class', 'noChild');
122                }
123            });
124        },
125        getMyCateList :function() {
126            var sMyCateList = localStorage.getItem("myCateList");
127            if (sMyCateList != null && sMyCateList != "") {
128                var aTempList = sMyCateList.split("|");
129                var aHtml = [];
130                for (var i = 0; i < aTempList.length; i++) {
131                    if (aTempList[i] != "") {
132                        var iCateNo = aTempList[i];
133                        var sCateName = aCategory[iCateNo].name;
134                        var sCateParam = aCategory[iCateNo].param;
135                        aHtml.push('<li id="bookmark'+iCateNo+'"><a href="/product/list_thumb.html'+sCateParam+'" book_mark="'+iCateNo+'">'+sCateName+'</a><button type="button" class="icoBookmark" onclick="setMyCateList('+iCateNo+');">즐겨찾기 삭제</button></li>');
136                        $("#cate"+iCateNo+" #icoBookmark").addClass("selected");
137                    }
138                }
139                $('#bookmartCateArea').append('<ul>'+aHtml.join('')+'</ul>');
140            }
141        }
142    };
143
144
145    methods.get();
146
147
148
149    $('#slideCateList li > a.cate').on('click', function(e) {
150        var sParam = $(this).attr('cate');
151        if (!sParam) return;
152        var iCateNo = Number(methods.getParam(sParam, 'cate_no'));
153        if ($(this).parent().attr('class') == 'xans-record- selected') {
154            methods.close();
155        } else {
156            if (!iCateNo) return;
157            $('#aside #slideCateList li').removeClass('selected');
158            methods.close();
159            if ($(this).parent().find('.slideSubMenu').length == 0)        {
160				methods.show(this.parentNode, iCateNo);
161            }
162        }
163    });
164
165    $('#aside').on('click', 'ul a.cate', function(e) {
166            $(this).parent().find('li').removeClass('selected');
167            $(this).parent().toggleClass('selected');
168            if (!$(this).parent('li').hasClass('noChild')){
169                e.preventDefault();
170            }
171    });
172});
173
174function checkInArray(sBookmarkList, iCateNo) {
175    if (sBookmarkList == null) return false;
176    var aBookmarkList = sBookmarkList.split("|");
177    for (var i = 0; i < aBookmarkList.length; i++) {
178        if (aBookmarkList[i] == iCateNo) {
179            return true;
180        }
181    }
182    return false;
183}
184
185
186$(document).ready(function () {
187    setInterval(function () {
188		if ( $('.slideSubMenu li.all').length == 0){
189			$('aside #slideCateList > ul > li > a').each(function () {
190				$(this).click();
191			});
192
193			$('aside #slideCateList > ul > li').each(function () {
194				if ($(this).find('> ul').length > 0) {
195					$(this).click(function () {
196						$(this).find('> ul').slideToggle(200);
197						$(this).find('> a i').toggleClass('xi-rotate-180');
198					});
199				}
200			});
201
202			$('.slideSubMenu').each(function () {
203				$(this).prepend('<li class=all><a href=/product/list.html' + $(this).parent().find('> a').attr('cate') + '>전체보기</a></li>');
204			});
205		}
206        
207    }, 300);
208});
209
210$(function(){
211    // 토글
212    $('div.eToggle .title').off('click').on('click', function() {
213        var toggle = $(this).parent('.eToggle');
214        if(toggle.hasClass('disable') == false){
215            $(this).parent('.eToggle').toggleClass('selected')
216        }
217    });
218
219    $('dl.eToggle dt').on('click', function() {
220        $(this).toggleClass('selected');
221        $(this).next('dd').toggleClass('selected');
222    });
223
224    //장바구니 페이지 수량폼 Type 변경
225    $('[id^="quantity"]').each(function() {
226        $(this).get(0).type = 'tel';
227    });
228
229    // 모바일에서 공급사 테이블 th 강제조절
230    $('.xans-mall-supplyinfo, .supplyInfo').find('table > colgroup').find('col').eq(0).width(98);
231    $('.xans-mall-supplyinfo, .supplyInfo').find('th, td').css({padding:'13px 10px 12px'});
232
233
234    /**
235     *  구매버튼
236     */
237    var globalBuyBtnScrollFunc = function() {
238        // 구매버튼 관련변수
239        var sFixId = $('#orderFixItem').length > 0  ? 'orderFixItem' : 'fixedActionButton',
240            $area = $('#orderFixArea'),
241            $item = $('#' + sFixId + '').not($area);
242
243        $(window).on('scroll', function() {
244            try {
245                // 구매버튼 관련변수
246                var iCurrentHeightPos = $(this).scrollTop() + $(this).height(),
247                    iButtonHeightPos = $item.offset().top;
248
249                if (iCurrentHeightPos > iButtonHeightPos || iButtonHeightPos < $(this).scrollTop() + $item.height()) {
250                    if (iButtonHeightPos < $(this).scrollTop() - $item.height()) {
251                        $area.fadeIn('fast');
252                    } else {
253                        $area.hide();
254                    }
255                } else {
256                    $area.fadeIn('fast');
257                }
258            } catch(e) { }
259        });
260    };
261
262    globalTopBtnScrollFunc();
263    globalBuyBtnScrollFunc();
264});
265
266// 공통레이어팝업 오픈
267var globalLayerOpenFunc = function(_this) {
268    this.id = $(_this).data('id');
269    this.param = $(_this).data('param');
270    this.basketType = $('#basket_type').val();
271    this.url = $(_this).data('url');
272    this.layerId = 'ec_temp_mobile_layer';
273    this.layerIframeId = 'ec_temp_mobile_iframe_layer';
274
275    var _this = this;
276
277    function paramSetUrl() {
278        if (this.param) {
279            // if isset param
280        } else {
281            this.url = this.basketType ?  this.url + '?basket_type=' + this.basketType : this.url;
282        }
283    };
284
285    if (this.url) {
286        window.ecScrollTop = $(window).scrollTop();
287        $.ajax({
288            url : this.url,
289            success : function (data) {
290                if (data.indexOf('404 페이지 없음') == -1) {
291                    // 있다면 삭제
292                    try { $(_this).remove(); } catch ( e ) { }
293
294                    var $layer = $('<div>', {
295                        html: $("<iframe>", { src: _this.url, id: _this.layerIframeId, scrolling: 'auto', css: { width: '100%', height: '100%', overflowY: 'auto', border: 0 } } ),
296                        id: _this.layerId,
297                        css : { position: 'absolute', top: 0, left:0, width: '100%', height: $(window).height(), 'z-index': 9999 }
298                    });
299
300                    $('body').append($layer);
301                    $('html, body').css({'overflowY': 'hidden', height: '100%', width: '100%'});
302                    $('#' + this.layerId).show();
303                }
304            }
305        });
306    }
307};
308
309// 공통레이어팝업 닫기
310var globalLayerCloseFunc = function() {
311    this.layerId = 'ec_temp_mobile_layer';
312
313    if (window.parent === window)
314        self.close();
315    else {
316        parent.$('html, body').css({'overflowY': 'auto', height: 'auto', width: '100%'});
317        parent.$('html, body').scrollTop(parent.window.ecScrollTop);
318        parent.$('#' + this.layerId).remove();
319    }
320};
321
322/**
323 * document.location.href split
324 * return array Param
325 */
326var getQueryString = function(sKey)
327{
328    var sQueryString = document.location.search.substring(1);
329    var aParam = {};
330
331    if (sQueryString) {
332        var aFields = sQueryString.split("&");
333        var aField  = [];
334        for (var i=0; i<aFields.length; i++) {
335            aField = aFields[i].split('=');
336            aParam[aField[0]] = aField[1];
337        }
338    }
339
340    aParam.page = aParam.page ? aParam.page : 1;
341    return sKey ? aParam[sKey] : aParam;
342};
343
344// PC버전 바로 가기
345var isPCver = function() {
346    var sUrl = window.location.hostname;
347    var aTemp = sUrl.split(".");
348
349    var pattern = /^(mobile[\-]{2}shop[0-9]+)$/;
350
351    if (aTemp[0] == 'm' || aTemp[0] == 'skin-mobile' || aTemp[0] == 'mobile') {
352        sUrl = sUrl.replace(aTemp[0]+'.', '');
353    } else if (pattern.test(aTemp[0]) === true) {
354        var aExplode = aTemp[0].split('--');
355        aTemp[0] = aExplode[1];
356        sUrl = aTemp.join('.');
357    }
358    window.location.href = '//'+sUrl+'/?is_pcver=T';
359};
360
361/* 도움말 */
362$('body').on('click', '.ec-base-tooltip-area .eTip', function(e){
363    var findArea = $($(this).parents('.ec-base-tooltip-area'));
364    var findTarget = $($(this).siblings('.ec-base-tooltip'));
365    var findTooltip = $('.ec-base-tooltip');
366    $('.ec-base-tooltip-area').removeClass('show');
367    $(this).parents('.ec-base-tooltip-area').first().addClass('show');
368    findTooltip.hide();
369    findTarget.show();
370    e.preventDefault();
371});
372
373$('body').on('click', '.ec-base-tooltip-area .eClose', function(e){
374    var findTarget = $(this).parents('.ec-base-tooltip').first();
375    $('.ec-base-tooltip-area').removeClass('show');
376    findTarget.hide();
377    e.preventDefault();
378});
379
380$('.ec-base-tooltip-area').find('input').on('focusout', function() {
381    var findTarget = $(this).parents('.ec-base-tooltip-area').find('.ec-base-tooltip');
382    $('.ec-base-tooltip-area').removeClass('show');
383    findTarget.hide();
384});
385
386/**
387 * 팝업창에 리사이즈 관련
388 */
389
390function setResizePopup() {
391
392    if(!$('#popup').length) return;
393
394    var iWrapWidth    = $('#popup').width();
395    var iWrapHeight   = $('#popup').height();
396
397    var iWindowWidth  = $(window).width();
398    var iWindowHeight = $(window).height();
399
400    window.resizeBy(iWrapWidth - iWindowWidth, iWrapHeight - iWindowHeight);
401}
402setResizePopup();
403
404// 팝업 페이지 로드가 완료된 후에 리사이징 함수를 다시 호출
405$( window ).on('load', function() {
406    setResizePopup();
407});
408/****************************** header ***************************************/
409
410var oneTop = new Swiper('#oneTop', {
411	direction: 'vertical',
412	autoplay: {
413		delay: 2500,          
414	},
415	speed:600,
416});
417
418
419$('header .one-pc .left').hover(function(){
420	$('body').addClass('mask');
421},function(){
422	$('body').removeClass('mask');
423});
424
425
426
427
428$('header .one-mobile .menu-icon').click(function() {
429    $(this).toggleClass('btnAll');
430    $('body').toggleClass('mask');
431
432    $('body').on('click', '#one_mask, header .one-mobile .menu-icon.btnAll', function(event) {
433        if ($(event.target).is('.menu-icon, #one_mask')) {
434            $('body').removeClass('mask');
435            $('#menu_toggle').prop('checked', false);
436        }
437    });
438
439    $('body').removeClass('search');
440    $('body #one_sear').removeClass('open');
441});
442
443
444$('aside .menu > ul > li').click(function(){
445	var idx = $(this).index();
446	$('aside .menu > ul > li').removeClass('active');
447	$(this).addClass('active');
448	$('aside .cons > *').hide();
449	$('aside .cons > *').eq(idx).show();
450});
451
452
453// www
454
455if ($('header > ul > .right .www li').length > 1){
456	$('header > ul > .right .www').addClass('show');
457}
458$('header > ul > .right .www').click(function(){
459	$(this).toggleClass('active');
460});
461
462
463/****************************** header 카테고리 나누기 ***************************************/
464
465if ($('header .hidden #category li').length < 13){
466	$('header .hidden > ul > div').each(function(){
467		var itemsPerGroup = 6; // 한 그룹당 아이템 수
468		var $list = $('header .hidden #category .one_scrollbar');
469		var $items = $list.children('li');
470
471		for (var i = 0; i < $items.length; i += itemsPerGroup) {
472			$items.slice(i, i + itemsPerGroup).wrapAll('<ul>');
473		}
474	});
475} else {
476	$('header .hidden > ul > div > #category > div').addClass('column');
477}
478
479document.querySelectorAll('header .hidden > ul > div > #category > div > ul > li > a').forEach(a => {
480  if (a.textContent.trim().toLowerCase() === 'sale') {
481    a.parentElement.classList.add('point');
482  }
483});
484
485document.querySelectorAll('aside #one_cate > ul > div > ul > li > a > *').forEach(el => {
486  if (el.textContent.trim().toLowerCase() === 'sale') {
487    el.closest('li').classList.add('point');
488  }
489});
490
491window.addEventListener('load', function() {
492  const selectors = [
493    // PC 구조
494    'aside #one_cate > ul > div > ul > li > a > *',
495    // 모바일 구조 (slideCateList 안쪽)
496    '#one_cate #slideCateList ul li a span'
497  ];
498
499  selectors.forEach(sel => {
500    document.querySelectorAll(sel).forEach(el => {
501      if (el.textContent.trim().toLowerCase() === 'sale') {
502        el.closest('li').classList.add('point');
503      }
504    });
505  });
506});
507
508/****************************** 검색 ***************************************/
509
510$('header .search').click(function() {
511	if (!$('body').hasClass('search') === true){
512		$('body').addClass('mask');
513		$('body').addClass('search');
514		$('#one_sear').addClass('open');
515		$('#menu_toggle').prop('checked', false);
516		$('#one_sear .close,body.search #one_mask').click(function(){
517			$('#one_sear').removeClass('open');
518			$('body').removeClass('mask');
519			$('body').removeClass('search');
520			
521		});
522	} else {
523		$('body').removeClass('mask');
524		$('body').removeClass('search');
525		$('#one_sear').removeClass('open');
526	}
527
528
529	$('#one_sear .searBox fieldset input').attr('placeholder','검색어를 입력하세요');
530
531});
532
533
534
535
536
537
538
539
540
541
542/****************************** 경로인식 ***************************************/
543
544var pageUrl = (window.location.href);
545
546if (pageUrl.match('/product/list.html')){
547	$('header > ul > .left > ul > li').eq(0).addClass("active");
548} else if (pageUrl.match('/board/') || pageUrl.match('board_no')){
549	$('header > ul > .left > ul > li').eq(2).addClass("active");
550}
551
552
553
554
555
556
557/****************************** footer 토글 ***************************************/
558
559
560
561$('footer .infomation .btn').click(function(){
562	$('footer .infomation').toggleClass('active');
563});
564
565
566function scrollToBottom() {
567    let previousHeight = 0;
568    
569    // 문서 높이가 변화할 때까지 반복
570    const interval = setInterval(function() {
571        const currentHeight = $(document).height();
572
573        // 현재 높이가 이전 높이와 동일하면, 변화가 없다고 판단하고 종료
574        if (previousHeight === currentHeight) {
575            clearInterval(interval);
576        } else {
577            $(window).scrollTop(currentHeight); // 최하단으로 이동
578            previousHeight = currentHeight; // 높이를 최신으로 갱신
579        }
580    }, 100); // 0.1초마다 높이 체크
581}
582
583// 버튼 클릭 시 실행
584$(".btnDown").click(function() {
585    scrollToBottom();
586});
587
588
589
590
591
592$('#left_board > ul > li').each(function(){
593	var title1 = $('.titleSub h2 > span').text();
594	var title2 = $(this).find('a').text();
595	if (title2.match(title1)){
596		$(this).addClass('active');
597	}
598});
599
600
601$('.xans-board li .info > a .displaynone').remove();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.