PageSourceSearch

https://cookandchan.kr/js/shop.mobile.main.js

js cookandchan.kr collected 2026-10-08 23:28:13 UTC 4,325 bytes, 156 lines download raw bytes

1(function($) {
2    $.fn.swipeSlide = function(option)
3    {
4        var cfg = {
5                slides: ".swipe-wrap > div",
6                buttons: ".mli_btn > button",
7                tabOffset: 10,
8                startSlide: 0,
9                auto: 0,
10                continuous: true,
11                disableScroll: false,
12                stopPropagation: false,
13                transitionEnd: function(index, element) {
14                    set_height(index);
15                    idx = index;
16                }
17            };
18
19        if(typeof option == "object")
20            cfg = $.extend( cfg, option );
21
22        var $wrap = this;
23        var $slides = this.find(""+cfg.slides+"");
24        var $btns;
25
26        var idx = cfg.startSlide;
27        var count = $slides.length;
28        var width, height;
29        var tab = null;
30
31        if(count < 1)
32            return;
33
34        function tab_make()
35        {
36            if(count < 2)
37                return;
38
39            if(tab == null) {
40                tab = "<div class=\"mli_btn\"><button type=\"button\" class=\"mli_pre\">이전 리스트</button><button type=\"button\" class=\"mli_next\">다음 리스트</button></div>";
41
42                $slides.each(function() {
43                    $(this).find("header").append(tab);
44                });
45
46                $btns = $wrap.find(""+cfg.buttons+"");
47            }
48        }
49
50        function set_height(idx)
51        {
52            var offset = $wrap.outerHeight() - $wrap.height();
53
54            height = $slides.eq(idx).height() + offset;
55            $wrap.height(height);
56        }
57
58        function init()
59        {
60            if(tab == null)
61                tab_make();
62        }
63
64        init();
65
66        window.mySwipe = Swipe(this[0], {
67            startSlide: cfg.startSlide,
68            auto: cfg.auto,
69            continuous: cfg.continuous,
70            disableScroll: cfg.disableScroll,
71            stopPropagation: cfg.stopPropagation,
72            callback: cfg.callback,
73            transitionEnd: cfg.transitionEnd
74        });
75
76        if(count > 0 && mySwipe) {
77            $btns.on("click", function() {
78                if($(this).hasClass("mli_next")) {
79                    idx = (idx + 1) % count;
80                } else {
81                    idx = (idx - 1);
82                    if(idx == -1)
83                        idx = count - 1;
84                }
85
86                mySwipe.slide(idx);
87            });
88        }
89    }
90}(jQuery));
91
92(function($) {
93    $.fn.bannerSlide = function(option)
94    {
95        var cfg = {
96                wrap: ".slide-wrap",
97                slides: ".slide-wrap > li",
98                buttons: ".silde_btn > button",
99                btnActive: "bn_sl",
100                startSlide: 0,
101                auto: 0,
102                continuous: true,
103                disableScroll: false,
104                stopPropagation: false,
105                callback: function(index, element) {
106                  button_change(index);
107                },
108                transitionEnd: function(index, element) {
109                    idx = index;
110                }
111            };
112
113        if(typeof option == "object")
114            cfg = $.extend( cfg, option );
115
116        var $wrap = this.find(""+cfg.wrap+"");
117        var $slides = this.find(""+cfg.slides+"");
118        var $btns = this.find(""+cfg.buttons+"");
119
120        var idx = cfg.startSlide;
121        var count = $slides.length;
122        var width, outerW;
123
124        if(count < 1)
125            return;
126
127        function button_change(idx)
128        {
129            if(count < 2)
130                return;
131
132            $btns.removeClass(cfg.btnActive)
133                 .eq(idx).addClass(cfg.btnActive);
134        }
135
136        window.bnSwipe = Swipe(this[0], {
137            startSlide: cfg.startSlide,
138            auto: cfg.auto,
139            continuous: cfg.continuous,
140            disableScroll: cfg.disableScroll,
141            stopPropagation: cfg.stopPropagation,
142            callback: cfg.callback,
143            transitionEnd: cfg.transitionEnd
144        });
145
146        if(count > 0 && bnSwipe) {
147            $btns.on("click", function() {
148                if($(this).hasClass(""+cfg.btnActive+""))
149                    return false;
150
151                idx = $btns.index($(this));
152                bnSwipe.slide(idx);
153            });
154        }
155    }
156}(jQuery));

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.