PageSourceSearch

https://www.re-lshop.com/view/asset/user-2-1-17-51f65878ad3c8c36fef3f9dfd233b0f9.js

js re-lshop.com collected 2026-10-08 20:28:13 UTC 9,307 bytes, 277 lines download raw bytes

1$(function() {
2    // ヘッダーのサイズ調整
3    headerAdjust();
4    $(window).on('scroll', function() {
5        headerAdjust();
6    });
7    
8    // カレンダー特定日の設定
9    $('.day-list').each(function() {
10        var month = $(this).attr('data-month');
11        var day = $(this).attr('data-day');
12        var color = $(this).attr('data-color');
13
14        $('.makeshop-calendar' + month +' .day' + day).css({
15            'background-color': color,
16            'color': '#fff',
17            'font-weight': 'bold',
18            'height': '14px'
19        });
20    });
21    
22    // 検索フォーム
23    $('.search-keyword, .search-price, .original-code').on('keypress', function(e) {
24        if (e.keyCode == 13) {
25            $('.search-url')[0].click();
26        }
27    });
28    
29    // ハンバーガーメニュー
30    $('.openbtn').on('click', function() {
31        $(this).toggleClass('active');
32        $('#g-nav').toggleClass('panelactive');
33    });
34    
35    // サイドメニューを閉じる
36    $('#g-nav a').on('click', function() {
37        $('.openbtn').removeClass('active');
38        $('#g-nav').removeClass('panelactive');
39    });
40    
41    // サイドメニューのカテゴリー開閉
42    $('.accordion').on('click', function() {
43        $(this).toggleClass('on').next().slideToggle();
44        $('.accordion').not(this).removeClass('on').next('.close').slideUp();
45    });
46});
47
48function headerAdjust() {
49    var adjustPoint = 20;
50    var scrollTop = $(window).scrollTop();
51    if(scrollTop > adjustPoint) {
52        $('.header').addClass('fix');
53    } else {
54        $('.header').removeClass('fix');
55    }
56}
57
58function MakeShop_afterListCartEntry(data){
59    if (!data.result) {
60        data.method.modal(data.error.message, function() {
61            location.href = '/view/item/' + data.systemCode;
62        });
63
64        return false;
65    }
66}
67
68// fixed header (keeps mega_menu also fixed)
69window.addEventListener('scroll', function () {
70    const header = document.querySelector('.header');
71    if (!header) return;
72    if (window.scrollY > header.offsetHeight + 50) {
73        header.classList.add('is-fixed');
74        $('.mega_menu').addClass('is-fixed');
75    } else {
76        header.classList.remove('is-fixed');
77        $('.mega_menu').removeClass('is-fixed');
78    }
79});
80
81// ハンバーガー(ヘッダー右)トグル
82$(document).ready(function() {
83  $('#js-ham-toggle').on('click', function() {
84    $(this).toggleClass('is-ham-open');
85    $('.header_nav_area').toggleClass('is-open');
86    $('body').toggleClass('ham-open');
87    $('.header_search').toggleClass('is-open');
88    $('.header_important').toggleClass('is-open');
89    $('.header_sp_nav').toggleClass('is-open');
90  });
91});
92
93// 範囲外クリックでハンバーガーに影響するクラスを外す(既存の処理)
94$(document).on('click', function(event) {
95  if (!$(event.target).closest('#js-ham-toggle, .header_nav_area').length) {
96    $('body').removeClass('menu-open');
97    $('#js-ham-toggle').removeClass('is-active');
98  }
99});
100
101// more_menu-toggle(SP等)の既存処理
102$(document).ready(function() {
103  $('.more_menu-toggle').on('click', function() {
104    $(this).toggleClass('is-open');
105    $(this).next('div').slideToggle(500);
106  });
107});
108
109// SPメニュー用トグル(既存)
110$(document).ready(function() {
111  // 家具
112  $('body').on('click', '.header_sp_nav_list_link_item-all', function(event) {
113    event.stopPropagation();
114    const target = $('.header_sp_nav_list_item_more.more_menu_item-all');
115    const isOpen = target.is(':visible'); // ← 開いているか判定
116
117    $('.header_sp_nav_list_item_more').slideUp(500); // 全部閉じる
118
119    if (!isOpen) {
120      target.slideDown(500); // 閉じてたら開く
121    }
122  });
123
124  // 雑貨
125  $('body').on('click', '.header_sp_nav_list_link_item-zakka', function(event) {
126    event.stopPropagation();
127    const target = $('.header_sp_nav_list_item_more.more_menu_item-zakka');
128    const isOpen = target.is(':visible');
129
130    $('.header_sp_nav_list_item_more').slideUp(500);
131
132    if (!isOpen) {
133      target.slideDown(500);
134    }
135  });
136
137  // サポート
138  $('body').on('click', '.header_sp_nav_list_link_support', function(event) {
139    event.stopPropagation();
140    const target = $('.header_sp_nav_list_item_more.more_menu_support');
141    const isOpen = target.is(':visible');
142
143    $('.header_sp_nav_list_item_more').slideUp(500);
144
145    if (!isOpen) {
146      target.slideDown(500);
147    }
148  });
149
150  // 範囲外クリックで全て閉じる
151  $(document).on('click', function(event) {
152    if (!$(event.target).closest('.header_sp_nav_list_link, .header_sp_nav_list_item_more').length) {
153      $('.header_sp_nav_list_item_more').slideUp(500);
154    }
155  });
156
157  // メニュー内クリック時は閉じない
158  $('.header_sp_nav_list_item_more').on('click', function(event) {
159    event.stopPropagation();
160  });
161});
162
163
164/* ===========================
165   PCメガメニュー(改良版:家具/雑貨/サポートを個別制御)
166   =========================== */
167$(function () {
168  let scrollPosition = 0;
169  const body = $('body');
170
171  // 各トリガー(HTMLで id を付与してください)
172  const btnOpen01 = $('#js-mega_menu-toggle01'); // 家具
173  const btnOpen02 = $('#js-mega_menu-toggle02'); // 雑貨
174  const btnOpen03 = $('#js-mega_menu-toggle03'); // サポート
175
176  // 各メニューセレクター(HTMLで .mega_menu01/.mega_menu02/.mega_menu03 を用意)
177  const menu01 = '.mega_menu01';
178  const menu02 = '.mega_menu02';
179  const menu03 = '.mega_menu03';
180
181  // 汎用:メニューを閉じる
182  function closeMegaMenu(toggleClass, menuSelector) {
183    body.removeClass(toggleClass);
184    if ($(window).width() <= 749) {
185      // モバイル時の固定解除とスクロール復元
186      body.css({ 'position': 'inherit', 'top': 0 });
187      window.scrollTo(0, scrollPosition);
188    } else {
189      $(menuSelector).stop(true, true).slideUp(200);
190      // 個別のボックスがある場合は透明に
191      $(menuSelector).find('.mega_menu_box').css('opacity', '0');
192    }
193  }
194
195  // 汎用:メニューを開く(PC/スマホ共通の挙動をここで扱う)
196  function openMegaMenu(toggleClass, menuSelector) {
197    body.addClass(toggleClass);
198    if ($(window).width() <= 749) {
199      scrollPosition = $(window).scrollTop();
200      body.css({ 'position': 'fixed', 'top': -scrollPosition });
201    } else {
202      $(menuSelector).stop(true, true).slideDown(200);
203      $(menuSelector).find('.mega_menu_box').css('opacity', '1');
204    }
205  }
206
207  // 汎用トグル(クリックトリガー)
208  function toggleMega(btn, toggleClass, menuSelector, otherMenus) {
209    if (!btn || !btn.length) return;
210    btn.on('click', function (e) {
211      e.stopPropagation();
212      // トグルする前に "otherMenus"(配列)にあるものを閉じる
213      otherMenus.forEach(function(m) {
214        if (body.hasClass(m.toggleClass)) {
215          closeMegaMenu(m.toggleClass, m.menuSelector);
216        }
217      });
218
219      if (body.hasClass(toggleClass)) {
220        // 既に開いている -> 閉じる
221        closeMegaMenu(toggleClass, menuSelector);
222      } else {
223        // 開いていない -> 開く
224        openMegaMenu(toggleClass, menuSelector);
225      }
226    });
227  }
228
229  // 家具ボタン
230  toggleMega(btnOpen01, 'is-mega_menu-open01', menu01, [
231    { toggleClass: 'is-mega_menu-open02', menuSelector: menu02 },
232    { toggleClass: 'is-mega_menu-open03', menuSelector: menu03 }
233  ]);
234
235  // 雑貨ボタン
236  toggleMega(btnOpen02, 'is-mega_menu-open02', menu02, [
237    { toggleClass: 'is-mega_menu-open01', menuSelector: menu01 },
238    { toggleClass: 'is-mega_menu-open03', menuSelector: menu03 }
239  ]);
240
241  // サポートボタン
242  toggleMega(btnOpen03, 'is-mega_menu-open03', menu03, [
243    { toggleClass: 'is-mega_menu-open01', menuSelector: menu01 },
244    { toggleClass: 'is-mega_menu-open02', menuSelector: menu02 }
245  ]);
246
247// ドキュメントクリックで開いているメニューを閉じる(他の要素には影響しない)
248$(document).on('click', function (e) {
249  // クリックがメガメニューやトリガー内の場合はスルー
250  if ($(e.target).closest('.mega_menu, .mega_menu-toggle, .header_nav_item').length) {
251    return;
252  }
253
254  if (body.hasClass('is-mega_menu-open01')) {
255    closeMegaMenu('is-mega_menu-open01', menu01);
256  }
257  if (body.hasClass('is-mega_menu-open02')) {
258    closeMegaMenu('is-mega_menu-open02', menu02);
259  }
260  if (body.hasClass('is-mega_menu-open03')) {
261    closeMegaMenu('is-mega_menu-open03', menu03);
262  }
263});
264
265  // メニュー内クリックでバブリングを阻止(メニュー外クリックで閉じないように)
266  $('.mega_menu01, .mega_menu02, .mega_menu03').on('click', function (e) {
267    e.stopPropagation();
268  });
269
270  // enterで検索を実行(ヘッダー検索)
271  $('.input-keyword, .input-price').on('keypress', function(e) {
272    if (e.keyCode == 13) {
273      $('.header-search-btn')[0].click();
274    }
275  });
276
277}); // $(function) end (メガメニュー終了)

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.