PageSourceSearch

https://dedra.co.kr/ind-script/optimizer_user.php?filename=dY5BDsI…18964b5016e490922256216&t=1790663926&user=T

js dedra.co.kr collected 2026-10-01 14:24:47 UTC 23,527 bytes, 793 lines download raw bytes

1$(document).ready(function(){
2    // 댓글 슬라이드 컨테이너 영역 추가
3    $('#container .boardComment').after('<div class="attach-image-slide displaynone"></div>');
4
5    // 댓글 슬라이드 닫기
6    $(document).on('click', '.attach-image-slide .commentimagelist-close', function(){
7        $('.attach-image-slide').addClass('displaynone');
8        $('.attach-image-slide').empty();
9    });
10
11    // 슬라이드 생성
12    $(document).on('click', '.xans-board-commentimagelist img', function(){
13        let eq = $(this).closest('li').index();
14        let clone = $(this).closest('ul').clone();
15        clone.find('li').addClass('swiper-slide');
16        clone.find('img').attr('style','');
17        clone.addClass('swiper-wrapper');
18        let swiper_html = $('<div class="swiper-container"></div>').append(clone);
19        swiper_html.append('<div class="swiper-pagination"></div>\n<div class="swiper-button-prev"></div>\n<div class="swiper-button-next"></div>\n<div class="commentimagelist-close"></div>');
20        $('.attach-image-slide').empty().append(swiper_html);
21
22        const swiper = new Swiper('.attach-image-slide .swiper-container', {
23            slidesPerView: 1,
24            loop : true,
25            spaceBetween: 0, 
26            speed: 600, 
27            grabCursor: true,
28            pagination: {
29                el: '.attach-image-slide .swiper-pagination',
30                clickable: true,
31            },
32            navigation: {
33                nextEl: '.attach-image-slide .swiper-button-next',
34                prevEl: '.attach-image-slide .swiper-button-prev',
35            },
36            on: {
37                init: function () {
38                    this.slideTo(eq + 1);
39                    $('.attach-image-slide').removeClass('displaynone');
40                },
41                slideChange : function(){
42                	console.log($(this.$el).find('.swiper-slide-active').length);
43                }
44            },
45        });
46    });
47});
48
49/**
50 * 움직이는 배너 Jquery Plug-in
51 * @author  cafe24
52 */
53
54(function($){
55
56    $.fn.floatBanner = function(options) {
57        options = $.extend({}, $.fn.floatBanner.defaults , options);
58
59        return this.each(function() {
60            var aPosition = $(this).position();
61            var jbOffset = $(this).offset();
62            var node = this;
63
64            $(window).on('scroll', function() {
65                var _top = $(document).scrollTop();
66                _top = (aPosition.top < _top) ? _top : aPosition.top;
67
68                setTimeout(function () {
69                    var newinit = $(document).scrollTop();
70
71                    if ( newinit > jbOffset.top ) {
72                        _top -= jbOffset.top;
73                        var container_height = $("#wrap").height();
74                        var quick_height = $(node).height();
75                        var cul = container_height - quick_height;
76                        if(_top > cul){
77                            _top = cul;
78                        }
79                    } else {
80                        _top = 0;
81                    }
82
83                    $(node).stop().animate({top: _top}, options.animate);
84                }, options.delay);
85            });
86        });
87    };
88
89    $.fn.floatBanner.defaults = {
90        'animate'  : 500,
91        'delay'    : 500
92    };
93
94})(jQuery);
95
96/**
97 * 문서 구동후 시작
98 */
99$(function(){
100    $('#banner:visible, #quick:visible').floatBanner();
101
102    //placeholder
103    $(".ePlaceholder input, .ePlaceholder textarea").each(function(i){
104        var placeholderName = $(this).parents().attr('title');
105        $(this).attr("placeholder", placeholderName);
106    });
107    /* placeholder ie8, ie9 */
108    $.fn.extend({
109        placeholder : function() {
110            //IE 8 버전에는 hasPlaceholderSupport() 값이 false를 리턴
111           if (hasPlaceholderSupport() === true) {
112                return this;
113            }
114            //hasPlaceholderSupport() 값이 false 일 경우 아래 코드를 실행
115            return this.each(function(){
116                var findThis = $(this);
117                var sPlaceholder = findThis.attr('placeholder');
118                if ( ! sPlaceholder) {
119                   return;
120                }
121                findThis.wrap('<label class="ePlaceholder" />');
122                var sDisplayPlaceHolder = $(this).val() ? ' style="display:none;"' : '';
123                findThis.before('<span' + sDisplayPlaceHolder + '>' + sPlaceholder + '</span>');
124                this.onpropertychange = function(e){
125                    e = event || e;
126                    if (e.propertyName == 'value') {
127                        $(this).trigger('focusout');
128                    }
129                };
130                //공통 class
131                var agent = navigator.userAgent.toLowerCase();
132                if (agent.indexOf("msie") != -1) {
133                    $(".ePlaceholder").css({"position":"relative"});
134                    $(".ePlaceholder span").css({"position":"absolute", "padding":"0 4px", "color":"#878787"});
135                    $(".ePlaceholder label").css({"padding":"0"});
136                }
137            });
138        }
139    });
140
141    $(':input[placeholder]').placeholder(); //placeholder() 함수를 호출
142
143    //클릭하면 placeholder 숨김
144    $('body').on('click', '.ePlaceholder span', function(){
145        $(this).hide();
146    });
147
148    //input창 포커스 인 일때 placeholder 숨김
149    $('body').on('focusin', '.ePlaceholder :input', function(){
150        $(this).prev('span').hide();
151    });
152
153    //input창 포커스 아웃 일때 value 가 true 이면 숨김, false 이면 보여짐
154    $('body').on('focusout', '.ePlaceholder :input', function(){
155        if (this.value) {
156            $(this).prev('span').hide();
157        } else {
158            $(this).prev('span').show();
159        }
160    });
161
162    //input에 placeholder가 지원이 되면 true를 안되면 false를 리턴값으로 던져줌
163    function hasPlaceholderSupport() {
164        if ('placeholder' in document.createElement('input')) {
165            return true;
166        } else {
167            return false;
168        }
169    }
170});
171
172/**
173 *  썸네일 이미지 엑박일경우 기본값 설정
174 */
175$(window).on('load', function() {
176    $("img.thumb,img.ThumbImage,img.BigImage").each(function($i,$item){
177        var $img = new Image();
178        $img.onerror = function () {
179            $item.src="//img.echosting.cafe24.com/thumb/img_product_big.gif";
180        }
181        $img.src = this.src;
182    });
183});
184
185/**
186 *  tooltip
187 */
188$('.eTooltip').each(function(i){
189    $(this).find('.btnClose').attr('tabIndex','-1');
190});
191//tooltip input focus
192$('.eTooltip').find('input').on('focus', function() {
193    var targetName = returnTagetName(this);
194    targetName.siblings('.ec-base-tooltip').show();
195});
196$('.eTooltip').find('input').on('focusout', function() {
197    var targetName = returnTagetName(this);
198    targetName.siblings('.ec-base-tooltip').hide();
199});
200function returnTagetName(_this){
201    var ePlacename = $(_this).parent().attr("class");
202    var targetName;
203    if(ePlacename == "ePlaceholder"){ //ePlaceholder 대응
204        targetName = $(_this).parents();
205    }else{
206        targetName = $(_this);
207    }
208    return targetName;
209}
210
211/**
212 *  eTab
213 */
214$("body").on("click", ".eTab a", function(e){
215    // 클릭한 li 에 selected 클래스 추가, 기존 li에 있는 selected 클래스는 삭제.
216    var _li = $(this).parent("li").addClass("selected").siblings().removeClass("selected"),
217    _target = $(this).attr("href"),
218    _siblings = $(_target).attr("class"),
219    _arr = _siblings.split(" "),
220    _classSiblings = "."+_arr[0];
221
222    //클릭한 탭에 해당하는 요소는 활성화, 기존 요소는 비활성화 함.
223    $(_target).show().siblings(_classSiblings).hide();
224
225
226    //preventDefault 는 a 태그 처럼 클릭 이벤트 외에 별도의 브라우저 행동을 막기 위해 사용됨.
227    e.preventDefault();
228});
229
230
231
232//window popup script
233function winPop(url) {
234    window.open(url, "popup", "width=300,height=300,left=10,top=10,resizable=no,scrollbars=no");
235}
236/**
237 * document.location.href split
238 * return array Param
239 */
240function getQueryString(sKey)
241{
242    var sQueryString = document.location.search.substring(1);
243    var aParam       = {};
244
245    if (sQueryString) {
246        var aFields = sQueryString.split("&");
247        var aField  = [];
248        for (var i=0; i<aFields.length; i++) {
249            aField = aFields[i].split('=');
250            aParam[aField[0]] = aField[1];
251        }
252    }
253
254    aParam.page = aParam.page ? aParam.page : 1;
255    return sKey ? aParam[sKey] : aParam;
256};
257
258$(function(){
259    // tab
260    $.eTab = function(ul){
261        $(ul).find('a').on('click', function(){
262            var _li = $(this).parent('li').addClass('selected').siblings().removeClass('selected'),
263                _target = $(this).attr('href'),
264                _siblings = '.' + $(_target).attr('class');
265            $(_target).show().siblings(_siblings).hide();
266            return false
267        });
268    }
269    if ( window.call_eTab ) {
270        call_eTab();
271    };
272});
273(function($){
274    $.fn.extend({
275        center: function() {
276            this.each(function() {
277                var
278                    $this = $(this),
279                    $w = $(window);
280                $this.css({
281                    position: "absolute",
282                    top: ~~(($w.height() - $this.outerHeight()) / 2) + $w.scrollTop() + "px",
283                    left: ~~(($w.width() - $this.outerWidth()) / 2) + $w.scrollLeft() + "px"
284                });
285            });
286            return this;
287        }
288    });
289    $(function() {
290        var $container = function(){/*
291    <div id="modalContainer">
292        <iframe id="modalContent" scroll="0" scrolling="no" frameBorder="0"></iframe>
293    </div>');
294    */}.toString().slice(14,-3);
295        $('body')
296        .append($('<div id="modalBackpanel"></div>'))
297        .append($($container));
298        function closeModal () {
299            $('#modalContainer').hide();
300            $('#modalBackpanel').hide();
301        }
302        $('#modalBackpanel').on('click',closeModal);
303        zoom = function ($piProductNo, $piCategoryNo, $piDisplayGroup) {
304            var $url = '/product/image_zoom.html?product_no=' + $piProductNo + '&cate_no=' + $piCategoryNo + '&display_group=' + $piDisplayGroup;
305            $('#modalContent').attr('src', $url);
306            $('#modalContent').on("load",function(){
307                $(".header .close",this.contentWindow.document.body).on("click", closeModal);
308            });
309            $('#modalBackpanel').css({width:$("body").width(),height:$("body").height(),opacity:.4}).show();
310            $('#modalContainer').center().show();
311        }
312    });
313})(jQuery);
314$(function(){
315    var loginButtons = document.querySelectorAll('.header-login-btn');
316    
317    loginButtons.forEach(function(button) {
318        button.addEventListener('click', function() {
319            var contentValue = document.querySelector('meta[name="path_role"]').getAttribute('content');
320
321            // 회원가입(MEMBER_JOIN)일 경우 returnUrl 없이 리다이렉트
322            if (contentValue == 'MEMBER_JOIN') {
323                window.location.href = '/member/login.html';
324                return true;
325            }
326
327            // 기존 queryString이 있으면 유지함
328            var existingParams = new URLSearchParams(window.location.search);
329            var returnUrl = existingParams.has('returnUrl') ? existingParams.get('returnUrl') : window.location.pathname + window.location.search;
330            existingParams.set('returnUrl', returnUrl);
331
332            window.location.href = '/member/login.html?' + existingParams.toString();
333        });
334    });
335});
336$(document).ready(function() {
337    var myElement = document.querySelector("#header");
338    var headerWrap = document.querySelector("#header-wrap");
339    var headroom;
340
341    // 높이와 offset을 다시 계산하고 적용하는 통합 함수
342    function updateHeaderLayout() {
343        // 1. 스크롤이 내려가서 헤더가 고정(접힌) 상태라면, 정확한 측정을 위해 잠시 원래대로 폅니다.
344        var wasNotTop = myElement.classList.contains("headroom--not-top");
345        if (wasNotTop) {
346            myElement.classList.remove("headroom--not-top");
347        }
348
349        // 3. 다 펴진 상태에서 정확한 offset 재계산
350        var isMobile = window.matchMedia("(max-width: 1028px)").matches;
351        var targetElement = isMobile ? document.querySelector(".moBtmBar") : document.querySelector("#header .btmArea");
352        var newOffset = targetElement ? (targetElement.offsetTop + targetElement.offsetHeight + 100) : 100;
353
354        // 4. Headroom 객체가 이미 있다면 offset 갱신
355        if (headroom) {
356            headroom.offset = newOffset;
357        }
358
359        // 5. 측정이 끝났으니, 원래 고정 상태였었다면 다시 클래스를 붙여줌
360        if (wasNotTop) {
361            myElement.classList.add("headroom--not-top");
362        }
363
364        return newOffset;
365    }
366
367    // 초기 Headroom 세팅
368    headroom = new Headroom(myElement, {
369        "offset": updateHeaderLayout(), // 초기 계산 실행
370        "tolerance": 5,
371        "classes": {
372            "pinned": "slideDown",
373            "unpinned": "slideUp"
374        }
375    });
376    headroom.init();
377
378    // 리사이즈 이벤트 (setTimeout을 활용해 창 크기 조절이 끝났을 때만 계산하여 과부하 방지)
379    var resizeTimer;
380    window.addEventListener('resize', function() {
381        clearTimeout(resizeTimer);
382        resizeTimer = setTimeout(function() {
383            updateHeaderLayout();
384        }, 150); // 창 조절을 멈추고 0.15초 뒤에 한 번만 실행
385    });
386});
387
388
389$(document).ready(function(){
390    /* 상단 배너 */
391    var topBannerNum = $('.topBanner .swiper-slide').length ;
392    $(".topBanner").each(function () {
393        var topBannerId = $(this).attr("id");
394        if (topBannerNum > 0){
395            if (getCookie(topBannerId) != "topDone") {
396                $("#" + topBannerId).show();
397            }
398        } else {
399            $(".topBanner").hide();
400        }
401    });
402
403    if (topBannerNum > 1){
404        var topBanner = new Swiper(".topBannerSwiper", {
405            speed: 600,
406            direction: 'vertical',
407            slidesPerView: 1,
408            spaceBetween: 0,
409            centeredSlides: false,
410            loop: true,
411            autoplay: {
412                delay: 2500,
413                disableOnInteraction: false,
414            },
415        });
416    }
417
418    $(".topBannerClose").click(function(e) {
419        e.preventDefault();
420        var $topBanner = $(this).closest(".topBanner");
421        $topBanner.animate({ height: 0, opacity: 0 }, 500, function() {
422            $topBanner.hide();
423            $('#container').css('padding-top','0'); // 여백도 원래대로
424        });
425    });
426
427    $("#header .midArea .rightArea a.searchBtn").click(function(e) {
428        e.preventDefault();
429
430    });
431
432
433
434    var joinSwiper = new Swiper(".joinSwiper", {
435        autoplay: {
436            delay: 3000,
437            disableOnInteraction: false,
438        },
439        loop:true,
440        effect:'fade'
441    });
442
443
444    /* PC 전체 메뉴 */
445    $("#openAllCate").click(function(e) {
446        e.preventDefault();
447       $("#categoryBox").addClass("active").fadeIn();
448    });
449
450    $("#cateClosed").click(function(e) {
451        e.preventDefault();
452        $("#categoryBox").remove("active").fadeOut();
453    });
454
455
456    var menuSwiperNum = $('.menuSwiper .swiper-slide a');
457    var menuSwiper = new Swiper('.menuSwiper', {
458        //freeMode: true,
459        slidesPerView: 'auto',
460    });
461
462    $("#openAll").click(function(e) {
463        e.preventDefault();
464        $(this).parent().toggleClass('active');
465        if($('.rightPoint').hasClass('active')){
466            $('.foldArea').slideDown();
467            $('.foldDim').fadeIn();
468        } else {
469            $('.foldArea').slideUp();
470            $('.foldDim').fadeOut();
471        }
472    });
473
474    $('#categoryA .cateList > li > a').on('click', function () {
475        $(this).parent('li').toggleClass('on').siblings().removeClass('on');
476    });
477
478    $('.tabBox .tab').on('click', function (e) {
479        e.preventDefault();
480        var target = $(this).data('tab');
481        $(this).addClass('on').siblings().removeClass('on');
482        $('.tabConBox .tabCon').removeClass('on');
483        $('#' + target).addClass('on');
484    });
485
486    $('#closeAside').on('click', function (e) {
487        e.preventDefault();
488        $('#aside').fadeOut().removeClass('active');
489
490    });
491
492    $('#openAside').on('click', function (e) {
493        e.preventDefault();
494        $('#aside').fadeIn().addClass('active');
495
496    });
497
498
499    $('#footer .toggleInfo dl dt').on('click', function () {
500        var $dl = $(this).closest('dl');
501        var isOpen = $dl.hasClass('on');
502
503        $('#footer .toggleInfo dl').removeClass('on').find('dd').slideUp(200);
504        if (!isOpen) {
505            $dl.addClass('on').find('dd').slideDown(200);
506        }
507    });
508
509    addPriceDividers();
510
511
512    var $topBtm = $('#topBtm');
513
514    $topBtm.hide();
515
516    $(window).on('scroll', function () {
517        if ($(this).scrollTop() > 300) {
518            $topBtm.stop(true, true).fadeIn(300);
519        } else {
520            $topBtm.stop(true, true).fadeOut(300);
521        }
522    });
523
524
525
526   $('.moveTop').click(function () {
527        $('html, body').stop().animate({scrollTop:0}, 500);
528        return false;
529    });
530
531    $('.moveBtm').click(function () {
532        $('html, body').stop().animate({scrollTop:$(document).height()}, 500);
533        return false;
534    });
535});
536
537
538
539$(function () {
540    var $searchBtn = $('#header .searchBtn');
541    var $searchBox = $('#searchBox');
542    var $searchClosed = $('#searchBox .searchClosed');
543
544    $searchBtn.on('click', function (e) {
545        e.preventDefault();
546        e.stopPropagation();
547
548        $searchBox.addClass('on');
549        $searchBox.find('#keyword').focus();
550    });
551
552    $searchClosed.on('click', function (e) {
553        e.preventDefault();
554        e.stopPropagation();
555
556        $searchBox.removeClass('on');
557    });
558
559    $searchBox.on('click', function (e) {
560        e.stopPropagation();
561    });
562
563    $(document).on('click', function () {
564        $searchBox.removeClass('on');
565    });
566
567    $(document).on('keydown', function (e) {
568        if (e.key === 'Escape') {
569            $searchBox.removeClass('on');
570        }
571    });
572});
573
574window.addPriceDividers = function() {
575    $('.ec-base-product .spec').each(function() {
576        const $spec = $(this);
577
578        if ($spec.find('.price-divider-line').length > 0) {
579            return;
580        }
581
582        const $prdPriceSale = $spec.find('.prd_price_sale');
583        const $productPrice = $spec.find('.product_price');
584        const $priceCustom = $spec.find('.price_custom, .product_custom');
585
586        if ($prdPriceSale.length > 0) {
587            $prdPriceSale.before('<div class="price-divider-line"></div>');
588        } else if ($productPrice.length > 0) {
589            $productPrice.before('<div class="price-divider-line"></div>');
590        } else if ($priceCustom.length > 0) {
591            $priceCustom.before('<div class="price-divider-line"></div>');
592        }
593    });
594}
595;
596
597
598
599
600
601$(function () {
602
603    setTimeout(function () {
604        checkDiscount();
605    }, 500);
606
607    var discountTimer = null;
608
609    var observer = new MutationObserver(function (mutations) {
610        var hasNewProduct = false;
611
612        mutations.forEach(function (mutation) {
613            if (mutation.addedNodes.length > 0) {
614                hasNewProduct = true;
615            }
616        });
617
618        if (hasNewProduct) {
619            clearTimeout(discountTimer);
620
621            discountTimer = setTimeout(function () {
622                checkDiscount();
623            }, 200);
624        }
625    });
626
627    observer.observe(document.body, {
628        childList: true,
629        subtree: true
630    });
631
632    $(document).on('click', '.moreBtn a, .btn_moreview a', function () {
633        setTimeout(function () {
634            checkDiscount();
635        }, 300);
636
637        setTimeout(function () {
638            checkDiscount();
639        }, 700);
640
641        setTimeout(function () {
642            checkDiscount();
643        }, 1200);
644    });
645
646
647
648});
649
650
651function checkDiscount() {
652
653    $('.RNW_rate').each(function () {
654
655        var $this = $(this);
656
657        if ($this.find('.RNW_per').length === 0) {
658
659            var $rnwPer = $('<li class="RNW_per xans-record-"><span class="per"></span></li>');
660            var $reviewCnt = $this.find('.spec .review_cnt');
661
662            if ($reviewCnt.length > 0) {
663                $reviewCnt.before($rnwPer);
664            } else {
665                $this.find('.spec').append($rnwPer);
666            }
667        }
668
669        var data_arr = ($this.attr('data-price') || '^^').split('^');
670
671        var custom_price = cleanPrice(data_arr[0]);
672        var selling_price = cleanPrice(data_arr[1]);
673
674        var $discountRate = $this.find('.discount_rate');
675        var sale_price = cleanPrice($discountRate.attr('data-sale-price'));
676
677        setRate(
678            $this,
679            custom_price,
680            selling_price,
681            sale_price,
682            ''
683        );
684
685        $this.removeClass('noneSale hasSale');
686
687        if (sale_price === '') {
688            $this.addClass('noneSale');
689        } else {
690            $this.addClass('hasSale');
691        }
692
693        var $couPrice = $this.find('.priceOri .cou');
694
695        if ($couPrice.length && !$couPrice.hasClass('displaynone')) {
696            $this.addClass('couSale');
697        } else {
698            $this.removeClass('couSale');
699        }
700
701    });
702
703}
704
705
706function cleanPrice(price) {
707
708    if (price === undefined || price === null) {
709        return '';
710    }
711
712    return String(price).replace(/[^0-9.]/g, '');
713
714}
715
716
717function setRate(_this, _custom_price, _selling_price, _discounted_price, _coupon_price) {
718
719    var $this = _this;
720
721    var basePrice = parseFloat(_custom_price);
722
723    if (isNaN(basePrice) || basePrice === 0) {
724        basePrice = parseFloat(_selling_price);
725    }
726
727    var finalPrice = parseFloat(_coupon_price);
728
729    if (isNaN(finalPrice) || finalPrice === 0) {
730        finalPrice = parseFloat(_discounted_price);
731    }
732
733    if (isNaN(finalPrice) || finalPrice === 0) {
734        finalPrice = parseFloat(_selling_price);
735    }
736
737    var rate = 0;
738
739    if (
740        !isNaN(basePrice) &&
741        basePrice > 0 &&
742        !isNaN(finalPrice) &&
743        finalPrice > 0
744    ) {
745        rate = 100 - Math.round(finalPrice / basePrice * 100);
746    }
747
748    var $per = $this.find('.RNW_per');
749
750    if (rate > 0) {
751        $per
752            .addClass('on')
753            .find('.per')
754            .html(rate + '<i>%</i>');
755    } else {
756        $per
757            .removeClass('on')
758            .find('.per')
759            .empty();
760    }
761
762}
763
764
765
766function setCookie(name, value, expiredays) {
767    var today = new Date();
768    today.setDate(today.getDate() + expiredays);
769
770    document.cookie = name + '=' + escape(value) + '; path=/; expires=' + today.toGMTString() + ';'
771}
772
773function getCookie(name) {
774    var cName = name + "=";
775    var x = 0;
776    while (x <= document.cookie.length)
777    {
778        var y = (x + cName.length);
779        if (document.cookie.substring(x, y) == cName)
780        {
781            if ((endOfCookie = document.cookie.indexOf(";", y)) == -1)
782                endOfCookie = document.cookie.length;
783            return unescape(document.cookie.substring(y, endOfCookie));
784        }
785        x = document.cookie.indexOf(" ", x) + 1;
786        if (x == 0)
787            break;
788    }
789    return "";
790}
791
792
793

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.