PageSourceSearch

https://kwos2.kanekashokuhin.co.jp/js/user.js

js kanekashokuhin.co.jp collected 2026-10-06 21:45:15 UTC 14,613 bytes, 297 lines download raw bytes

1// アコーディオン カテゴリツリー
2
3jQuery(window).on('load',function(){
4  // 
5    jQuery(".category_tree2_,.category_tree2_open_").prev(".category_tree1_,.category_tree1_open_").append('<span class="accordion_"></span>');
6    jQuery(".category_tree3_,.category_tree3_open_").prev(".category_tree2_,.category_tree2_open_").append('<span class="accordion_"></span>');
7    jQuery(".category_tree4_,.category_tree4_open_").prev(".category_tree3_,.category_tree3_open_").append('<span class="accordion_"></span>');
8
9    // 
10    jQuery(".category_tree_ li.category_tree1_ a,.category_tree_ li.category_tree1_open_ a,.category_tree_ li.category_tree1_ span.nolink,.category_tree_ li.category_tree2_ a,.category_tree_ li.category_tree2_ span.nolink,.category_tree_ li.category_tree3_ a,.category_tree_ li.category_tree3_ span.nolink,.category_tree_ li.category_tree4_ a, .category_tree_ li.category_tree4_ span.nolink").addClass("arrow");
11    
12    // 
13    jQuery(".category_tree2_,.category_tree2_open_").prev(".category_tree1_,.category_tree1_open_").find("a").removeClass("arrow");
14    jQuery(".category_tree3_,.category_tree3_open_").prev(".category_tree2_,.category_tree2_open_").find("a").removeClass("arrow");
15    jQuery(".category_tree4_,.category_tree4_open_").prev(".category_tree3_,.category_tree3_open_").find("a").removeClass("arrow");
16    // 
17
18    jQuery(".genre_tree2_,.genre_tree2_open_").prev(".genre_tree1_,.genre_tree1_open_").append('<span class="accordion_"></span>');
19    jQuery(".genre_tree3_,.genre_tree3_open_").prev(".genre_tree2_,.genre_tree2_open_").append('<span class="accordion_"></span>');
20    jQuery(".genre_tree4_,.genre_tree4_open_").prev(".genre_tree3_,.genre_tree3_open_").append('<span class="accordion_"></span>');
21
22    // 
23    jQuery(".genre_tree_ li.genre_tree1_ a,.genre_tree_ li.genre_tree1_open_ a,.genre_tree_ li.genre_tree1_ span.nolink,.genre_tree_ li.genre_tree2_ a,.genre_tree_ li.genre_tree2_ span.nolink,.genre_tree_ li.genre_tree3_ a,.genre_tree_ li.genre_tree3_ span.nolink,.genre_tree_ li.genre_tree4_ a, .genre_tree_ li.genre_tree4_ span.nolink").addClass("arrow");
24    
25    // 
26    jQuery(".genre_tree2_,.genre_tree2_open_").prev(".genre_tree1_,.genre_tree1_open_").find("a").removeClass("arrow");
27    jQuery(".genre_tree3_,.genre_tree3_open_").prev(".genre_tree2_,.genre_tree2_open_").find("a").removeClass("arrow");
28    jQuery(".genre_tree4_,.genre_tree4_open_").prev(".genre_tree3_,.genre_tree3_open_").find("a").removeClass("arrow");
29});
30
31jQuery(window).on('load',function(){
32
33  // カテゴリ第1階層
34  jQuery('.category_tree1_,.category_tree1_open_').each(function() {
35    let $nextLi = $(this).next();
36    if ($nextLi.hasClass('category_tree2_') || $nextLi.hasClass('category_tree2_open_')) {
37      $nextLi.nextUntil('.category_tree1_,.category_tree1_open_').addBack().wrapAll('<ul class="sub_tree_"></ul>');
38    }
39  });
40  // カテゴリ第2階層
41  jQuery('.category_tree2_,.category_tree2_open_').each(function() {
42    let $nextLi = $(this).next();
43    if ($nextLi.hasClass('category_tree3_') || $nextLi.hasClass('category_tree3_open_')) {
44      $nextLi.nextUntil('.category_tree2_,.category_tree2_open_').addBack().wrapAll('<ul class="sub_tree_"></ul>');
45    }
46  });
47  //カテゴリ2階層目
48  jQuery('.category_tree2_open_').parent('.sub_tree_').show();
49  jQuery('.category_tree2_open_').parent('.sub_tree_').prev('.category_tree1_').addClass('active');
50  //カテゴリ3階層目
51  jQuery('.category_tree3_open_').parent('.sub_tree_').show();
52  jQuery('.category_tree3_open_').parent('.sub_tree_').prev('.category_tree2_').addClass('active');
53  jQuery('.category_tree3_open_').parent('.sub_tree_').parent('.sub_tree_').show();
54  jQuery('.category_tree3_open_').parent('.sub_tree_').parent('.sub_tree_').prev('.category_tree1_').addClass('active');
55  // カテゴリ第3階層
56  jQuery('.category_tree3_,.category_tree3_open_').each(function() {
57    let $nextLi = $(this).next();
58    if ($nextLi.hasClass('category_tree4_') || $nextLi.hasClass('category_tree4_open_')) {
59      $nextLi.nextUntil('.category_tree3_,.category_tree3_open_').addBack().wrapAll('<ul class="sub_tree_"></ul>');
60    }
61  });
62  // カテゴリ階層展開
63  jQuery(".category_tree1_open_ > span,.category_tree1_ > span,.category_tree2_open_ .nolink_,.category_tree2_ .accnolink_ordion_,.category_tree3_open_ .nolink_,.category_tree3_ .nolink_,.category_tree4_open_ .nolink_,.category_tree4_ .nolink_").click(function(e) {
64      jQuery(this).parent('li').next(".sub_tree_").slideToggle('fast');
65      jQuery(this).parent('li').toggleClass('active');
66  });
67  jQuery(".category_tree2_open_ .accordion_,.category_tree2_ .accordion_,.category_tree3_open_ .accordion_,.category_tree3_ .accordion_,.category_tree4_open_ .accordion_,.category_tree4_ .accordion_").click(function(e) {
68      jQuery(this).parent('li').next(".sub_tree_").slideToggle('fast');
69      jQuery(this).parent('li').toggleClass('active');
70  });
71  // カテゴリ階層アクティブ
72  jQuery('.category_tree1_open_').addClass('active');
73  jQuery('.category_tree2_open_').addClass('active');
74  jQuery('.category_tree3_open_').addClass('active');
75  
76  // ジャンル第1階層
77  jQuery('.genre_tree1_,.genre_tree1_open_').each(function() {
78    let $nextLi = $(this).next();
79    if ($nextLi.hasClass('genre_tree2_') || $nextLi.hasClass('genre_tree2_open_')) {
80      $nextLi.nextUntil('.genre_tree1_,.genre_tree1_open_').addBack().wrapAll('<ul class="sub_tree_"></ul>');
81    }
82  });
83  // ジャンル第2階層
84  jQuery('.genre_tree2_,.genre_tree2_open_').each(function() {
85    let $nextLi = $(this).next();
86    if ($nextLi.hasClass('genre_tree3_') || $nextLi.hasClass('genre_tree3_open_')) {
87      $nextLi.nextUntil('.genre_tree2_,.genre_tree2_open_').addBack().wrapAll('<ul class="sub_tree_"></ul>');
88    }
89  });
90  //ジャンル2階層目
91  jQuery('.genre_tree2_open_').parent('.sub_tree_').show();
92  jQuery('.genre_tree2_open_').parent('.sub_tree_').prev('.genre_tree1_').addClass('active');
93  //ジャンル3階層目
94  jQuery('.genre_tree3_open_').parent('.sub_tree_').show();
95  jQuery('.genre_tree3_open_').parent('.sub_tree_').prev('.genre_tree2_').addClass('active');
96  jQuery('.genre_tree3_open_').parent('.sub_tree_').parent('.sub_tree_').show();
97  jQuery('.genre_tree3_open_').parent('.sub_tree_').parent('.sub_tree_').prev('.genre_tree1_').addClass('active');
98  // ジャンル第3階層
99  jQuery('.genre_tree3_,.genre_tree3_open_').each(function() {
100    let $nextLi = $(this).next();
101    if ($nextLi.hasClass('genre_tree4_') || $nextLi.hasClass('genre_tree4_open_')) {
102      $nextLi.nextUntil('.genre_tree3_,.genre_tree3_open_').addBack().wrapAll('<ul class="sub_tree_"></ul>');
103    }
104  });
105  // ジャンル階層展開
106  jQuery(".genre_tree1_open_ > span,.genre_tree1_ > span,.genre_tree2_open_ .nolink_,.genre_tree2_ .accnolink_ordion_,.genre_tree3_open_ .nolink_,.genre_tree3_ .nolink_,.genre_tree4_open_ .nolink_,.genre_tree4_ .nolink_").click(function(e) {
107      jQuery(this).parent('li').next(".sub_tree_").slideToggle('fast');
108      jQuery(this).parent('li').toggleClass('active');
109  });
110  jQuery(".genre_tree2_open_ .accordion_,.genre_tree2_ .accordion_,.genre_tree3_open_ .accordion_,.genre_tree3_ .accordion_,.genre_tree4_open_ .accordion_,.genre_tree4_ .accordion_").click(function(e) {
111      jQuery(this).parent('li').next(".sub_tree_").slideToggle('fast');
112      jQuery(this).parent('li').toggleClass('active');
113  });
114  // ジャンル階層アクティブ
115  jQuery('.genre_tree1_open_').addClass('active');
116  jQuery('.genre_tree2_open_').addClass('active');
117  jQuery('.genre_tree3_open_').addClass('active');
118});
119
120
121
122
123// スムーススクロール
124    jQuery(window).on('load',function(){
125      jQuery('a[href^="#"]:not(a.ui-tabs-anchor, a.top_assist_info_show_inline_)').click(function(){
126          let speed = 500;
127          let href= jQuery(this).attr("href");
128          let target = jQuery(href == "#" || href == "" ? 'html' : href);
129          let position = target.offset().top;
130          jQuery("html, body").animate({scrollTop:position}, speed, "swing");
131          return false;
132      });
133  });
134
135  // おすすめ商品ボタン横並び
136  jQuery(function(){
137    jQuery('.agency_event_detail_').nextAll('.submit_').wrapAll('<div class="agency_event_detail_submit-wrapper"></div>');
138    jQuery('.agency_event_detail_submit-wrapper .submit_').css('float','right');
139  });
140
141  // ページカテゴリ・サブカテゴリリスト調整用
142  jQuery(function(){
143    jQuery('.block-pagecategory-subcategory-list--category-image:not(:has(a))').css('padding','30px 0');
144  });
145
146  jQuery('.category_tree1_').each(function() {
147    let $nextLi = $(this).next();
148    if ($nextLi.hasClass('category_tree2_')) {
149      $nextLi.nextUntil('.category_tree1_').addBack().wrapAll('<ul class="sub_tree_"></ul>');
150    }
151  });
152
153jQuery(document).ready(function() {
154
155  let scrollElement;
156  if(jQuery('.total_footer_').length>0) {
157    scrollElement = jQuery('.total_footer_');
158  }else if(jQuery('.order_cart_list_total_').length>0) {
159    scrollElement = jQuery('.order_cart_list_total_');
160  }else if(jQuery('.bizorderlistedit_ .btn_').length>0) {
161    scrollElement = jQuery('.bizorderlistedit_ .btn_');
162  } else {
163    scrollElement = '';
164  }
165
166  const scrollElementpagetop = jQuery('.pagetop');
167  const footer = jQuery('footer');
168
169  function updatePosition() {
170    const currentScrollBottom = jQuery(window).scrollTop() + jQuery(window).height();
171    const footerTop = footer.offset().top;
172    const footerInnerHeight = footer.innerHeight();
173
174    if (scrollElement.length > 0) {
175      const footerheight = footerInnerHeight + 60;
176      if (currentScrollBottom >= footerTop) {
177        scrollElement.css({
178          'position': 'absolute',
179          'bottom': footerheight + 'px'
180        });
181      } else {
182        scrollElement.css({
183          'position': 'fixed',
184          'bottom': '0'
185        });
186      }
187      scrollElement.css('opacity', '1');
188    }
189
190    if (scrollElementpagetop.length > 0) {
191      const footerheightpagetop = footerInnerHeight + 190;
192      if (currentScrollBottom >= footerTop) {
193        scrollElementpagetop.css({
194          'position': 'absolute',
195          'bottom': footerheightpagetop + 'px'
196        });
197      } else {
198        scrollElementpagetop.css({
199          'position': 'fixed',
200          'bottom': '130px'
201        });
202      }
203      scrollElementpagetop.css('opacity', '1');
204    }
205  }
206  if(scrollElement !== ''){
207    jQuery(window).on('scroll', updatePosition);
208      updatePosition();
209    jQuery(window).on('load', function() {
210      updatePosition();
211    });
212  }
213
214
215  let goods_line_qty;
216  let goods_line_qty_value
217  jQuery('.goods_line_qty_controls_plus_').click(function(){
218    goods_line_qty = parseInt(jQuery(this).parent('.goods_line_qty_controls_').prev('.goods_line_qty_value_').find('input[type="text"]').val());  
219    goods_line_qty++;
220    jQuery(this).parent('.goods_line_qty_controls_').prev('.goods_line_qty_value_').find('input[type="text"]').val(goods_line_qty);
221    jQuery(this).parent('.goods_line_qty_controls_').prev('.goods_line_qty_value_').find('input[name="hdn_qty"]').val(goods_line_qty);
222  });
223  jQuery('.goods_line_qty_controls_minus_').click(function(){
224    goods_line_qty = parseInt(jQuery(this).parent('.goods_line_qty_controls_').prev('.goods_line_qty_value_').find('input[type="text"]').val());  
225    if(goods_line_qty > 1){
226      goods_line_qty--;
227      jQuery(this).parent('.goods_line_qty_controls_').prev('.goods_line_qty_value_').find('input[type="text"]').val(goods_line_qty);
228      jQuery(this).parent('.goods_line_qty_controls_').prev('.goods_line_qty_value_').find('input[name="hdn_qty"]').val(goods_line_qty);
229    }
230    
231  });
232
233  if(jQuery('.list-items_').length>0){
234    
235    jQuery('.list-items_').each(function(){
236      jQuery(this).find('.list-item_ h2').tile();
237      jQuery(this).find('.list-item_ p').tile();
238    });
239    
240  }
241  var scrollPos;
242  jQuery('.add-goods').click(function(){
243    jQuery('.order_modal_wrap_').addClass('fixed_');
244    if(jQuery('.order_modal_bg_').length===0){
245      scrollPos = jQuery(window).scrollTop(); 
246      jQuery('<div class="order_modal_bg_"><div class="order_modal_closebtn_"></div></div>').appendTo('body');
247    }
248    jQuery('.order_modal_wrap_ .order_list_ > div').tile();
249    jQuery('body').addClass('fixed').css({top: -scrollPos});
250    jQuery('.order_modal_closebtn_,.order_modal_bg_').on('click',function(){
251      jQuery('.order_modal_bg_').remove();
252      jQuery('.order_modal_wrap_').removeClass('fixed_');
253      jQuery('body').removeClass('fixed').css({ top: 0 });
254      jQuery(window).scrollTop(scrollPos);          
255    });    
256  });
257  if(jQuery('.selectbiz_.formlist_ tr td,.selectbiz_.formlist_ tr th').length>0){
258    jQuery('.selectbiz_.formlist_ tr td,.selectbiz_.formlist_ tr th').tile();
259  }
260
261  if(jQuery('.goodsspec_tabs_').length>0){
262    jQuery('.goodsspec_tab_').each(function(){
263      if(location.href.match(jQuery(this).attr('href'))){
264        jQuery(this).addClass('active_')
265      }
266    });
267  }
268});
269
270jQuery(window).on('load',function(){
271  if(jQuery('.top_newRecipe_item_').length > 3 && jQuery('.page-goods').length>0){
272    jQuery('.top_newRecipe_item_').addClass('swiper-slide');
273    jQuery('.top_newRecipe_list_').wrapInner('<div class="swiper"><div class="swiper-outer"><div class="swiper-wrapper"></div></div><div class="swiper-pagination"></div><div class="swiper-buttons"><div class="swiper-button-prev swiper-button"></div><div class="swiper-button-next swiper-button"></div></div></div>');
274    if(jQuery('.top_newRecipe_list_ .swiper').length>0){
275      const slider = new Swiper('.top_newRecipe_list_ .swiper-outer', {
276        loop: true,
277        speed: 300,
278        loopAdditionalSlides  : 0,
279        slidesPerView: 'auto',
280        centeredSlides: false,
281        pagination: {
282          el: '.top_newRecipe_list_ .swiper-pagination',
283          clickable: true,
284        },    
285        navigation: {
286          nextEl: '.top_newRecipe_list_ .swiper-button-next',
287          prevEl: '.top_newRecipe_list_ .swiper-button-prev',
288        },
289        on: {
290          init: function () {
291            document.querySelectorAll('.top_newRecipe_list_ .swiper-navigation-icon').forEach(el => el.remove());
292          },
293        },          
294      });
295    }
296  }
297});

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.