PageSourceSearch

https://w-clinic.shop/view/asset/user-3-1-3-d8da2d8d1e67aa5732e19ccb340ed7ff.js

js w-clinic.shop collected 2026-10-04 04:21:58 UTC 8,504 bytes, 269 lines download raw bytes

1$(function () {
2    const pcBreakPoint = 1000;
3
4    // ハンバーガー開閉
5    $('#js-hamburger-btn').on('click', function () {
6        $('#header-menu').stop(true, true).fadeToggle();
7        $('body').toggleClass('open');
8    });
9
10    $('#hamburger-close').on('click', function () {
11        $('#header-menu').stop(true, true).fadeOut();
12        $('body').removeClass('open');
13    });
14
15    // カテゴリメニュー(スマホのみ)
16    $('#header-nav-category .has-sub-category').on('click', function (e) {
17        if ($(window).width() < pcBreakPoint) {
18            e.preventDefault();
19            $(this).next().stop(true, true).slideToggle();
20            $(this).toggleClass('open');
21        }
22    });
23
24    // 会員メニュー
25    $('#header-member').on('click', function () {
26        $('#header-member-list').stop(true, true).slideToggle();
27        $(this).toggleClass('open');
28    });
29
30    // 検索 Enter でリンククリック
31    $('#header-search').on('keypress', function (e) {
32        if (e.which === 13) {
33            $('#header-search-link')[0].click();
34        }
35    });
36    //Enterキーで検索実行
37    $('.item-search-set input[type="text"]').on('keypress', function (e) {
38      var $parent = $(this).closest('.item-search-set');
39      if (e.keyCode == 13 && $parent.find('.button').length > 0) {
40        $parent.find('.button')[0].click();
41      }
42    });
43
44    // カレンダー特定日
45    $('.day-list').each(function () {
46        const month = $(this).data('month');
47        const day = $(this).data('day');
48        const color = $(this).data('color');
49
50        $(`.makeshop-calendar${month} .day${day}`).css({
51            backgroundColor: color,
52            color: '#fff',
53            fontWeight: 'bold'
54        });
55    });
56
57    // サイドナビとメイン高さ調整
58    if ($('#side-nav').is(':visible')) {
59        const sideNavHeight = $('#side-nav').height();
60        $('main').css('min-height', $('main').height() < sideNavHeight ? sideNavHeight : 0);
61    } else {
62        $('main').css('min-height', 0);
63    }
64
65    // アコーディオン共通処理
66    function initAccordion(triggerSelector, itemSelector, opts) {
67        const options = $.extend({ onlyBelow: null }, opts);
68        $(document).on('click', triggerSelector, function (e) {
69            if (options.onlyBelow && $(window).width() >= options.onlyBelow) {
70                return; // PC幅ではリンクとして動作
71            }
72            e.preventDefault();
73            const $item = $(this).closest(itemSelector);
74            const $submenu = $item.children('ul');
75            $item.toggleClass('open');
76            $submenu.stop(true, true).slideToggle(200);
77        });
78    }
79
80    // --- 大カテゴリ(タイトル → カテゴリ) ---
81    $('.header-nav-title').on('click', function (e) {
82        e.preventDefault();
83        const $title = $(this);
84        const $category = $title.next('.header-nav-category');
85        const willClose = $category.is(':visible');
86
87        $title.toggleClass('open');
88        $category.stop(true, true).slideToggle(200);
89
90        // 閉じるときは中のサブアコーディオンを全部閉じる
91        if (willClose) {
92            $category.find('.header-nav-sub-accordion-item.open')
93                .removeClass('open')
94                .children('ul').stop(true, true).slideUp(0);
95        }
96    });
97
98    // サイドナビのサブメニュー
99    initAccordion('.side-nav-sub-ttl', '.side-nav-sub-accordion-item');
100
101    // ヘッダーのサブメニュー(モバイルのみ開閉)
102    initAccordion('.header-nav-sub-ttl', '.header-nav-sub-accordion-item', { onlyBelow: pcBreakPoint });
103});
104//.search-overlay-menu
105$(function () {
106  $('.search-overlay-menu-trigger').on('click', function () {
107    if ($('html').hasClass('open')) {
108      sideMenuMotion();
109    }
110    $('#search-overlay-menu').fadeToggle('400');
111    $('html').toggleClass('no-scroll');
112    $('#search-keyword').focus();
113    $('#search-keyword').val("");
114  });
115});
116
117$(function () {
118    // スムーススクロール(固定100pxオフセット)
119    $('a[href*="#"]').on('click', function (e) {
120        const targetId = $(this).attr('href').split('#')[1];
121        if (!targetId) return; // #のみの場合は無視
122
123        const $target = $('#' + targetId);
124        if ($target.length) {
125            e.preventDefault();
126
127            // 固定オフセット
128            const headerOffset = 100;
129
130            // スクロール位置
131            const position = $target.offset().top - headerOffset;
132
133            $('html, body').animate({ scrollTop: position }, 500, 'swing');
134        }
135    });
136});
137
138
139//指定日時バナー表示/非表示
140$(document).ready(function() {
141  $(".view_timer").each(function(index, target) {
142    var startDate = $(this).attr("data-start-date");
143    var endDate = $(this).attr("data-end-date");
144    var nowDate = new Date();
145
146    if (startDate) {
147      startDate = new Date(startDate);
148    } else {
149      startDate = nowDate;
150    }
151    if (endDate) {
152      endDate = new Date(endDate);
153    }
154
155    if (startDate <= nowDate && (!endDate || nowDate <= endDate)) {
156      $(this).show();
157    } else {
158      $(this).hide();
159    }
160  });
161});
162
163
164
165
166
167
168
169
170
171
172
173
174
175$(function() {
176    var
177        $goodsImg           = $('#goods-img'),
178        $favoriteBtn        = $('#goods-cart-favorite'),
179        windowWidth         = $(window).width(),
180        windowBreakPoint    = 1000;
181
182    $(window).on('load', function() {
183        setGoodsImg();
184    });
185
186    function setGoodsImg() {
187        if ($goodsImg.find('li').length > 1) {
188            $('#goods-thumbnail li').each(function(index, element) {
189                $(element).find('a').attr('data-slide-index', index);
190            });
191            var goodsSlider = $goodsImg.bxSlider({
192                pagerCustom: '#goods-thumbnail',
193                onSliderLoad: function (currentIndex) {
194                    $('#goods-img-count-current').text(currentIndex + 1);
195                },
196                onSlideBefore: function ($slideElement, oldIndex, newIndex) {
197                    $('#goods-img-count-current').text(newIndex + 1);
198                }
199            });
200            $('#goods-img-count-total').text(goodsSlider.getSlideCount());
201        }
202    }
203
204    $('#goods-quantity-up').on('click', function() {
205        changeQuantity($('#goods-quantity-input'), 'up', $('#goods-quantity-down'));
206    });
207
208    $('#goods-quantity-down').on('click', function() {
209        changeQuantity($('#goods-quantity-input'), 'down', $('#goods-quantity-down'));
210    });
211
212    function changeQuantity($target, mode, $btn) {
213        var
214            oldQuantity = parseInt($target.val(), 10),
215            newQuantity = 0;
216
217        switch (mode) {
218            case 'up':
219                newQuantity = oldQuantity + 1;
220                break;
221            case 'down':
222                newQuantity = oldQuantity - 1;
223                break;
224        }
225
226        if (windowBreakPoint > windowWidth) {
227            if (newQuantity <= 1) {
228                $btn.hide();
229            } else {
230                $btn.show();
231            }
232        }
233
234        if (newQuantity >= 1) {
235            $target.val(newQuantity);
236        }
237    }
238
239    $favoriteBtn.find('a').on('click', function() {
240        $favoriteBtn.addClass('add-favorite');
241    });
242
243    $('img.option-image').on('click', function() {
244        showOptionImage($(this).attr('data-option-image'));
245    });
246
247    // ▼ 追加部分:.article の末尾へスクロール
248   $('a[href="#article-end"]').on('click', function(e) {
249        e.preventDefault();
250
251        var $article = $('.article');
252        var $goodsText = $('#goods-text');
253        var scrollTarget;
254
255        if ($article.length) {
256            // .article の一番下までスクロール
257            scrollTarget = $article.offset().top + $article.outerHeight();
258        } else if ($goodsText.length) {
259            // #goods-text の100px上に余白をもってスクロール
260            scrollTarget = $goodsText.offset().top - 100;
261        } else {
262            return; // どちらも存在しない場合は何もしない
263        }
264
265        $('html, body').animate({
266            scrollTop: scrollTarget
267        }, 600);
268    });
269});

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.