PageSourceSearch

https://o-ki.co.jp/common/js/script.js

js o-ki.co.jp collected 2026-10-04 19:10:40 UTC 27,982 bytes, 920 lines download raw bytes

1jQuery(function ($) {
2  var menu_trigger = $("#menu_trigger");
3  var navi = $("#navi");
4  var navi_close = $("#navi .close");
5  var winHeight = $(window).height();
6  var navHeight = winHeight - 102;
7  var property;
8
9  navi.hide();
10
11  menu_trigger.on("click", function () {
12    navi.stop().slideToggle();
13    navi.toggleClass("active");
14    $(this).toggleClass("active");
15  });
16  navi_close.on("click", function () {
17    navi.stop().slideUp();
18    navi.toggleClass("active");
19    menu_trigger.toggleClass("active");
20  });
21
22  $(window).on("load resize", function () {
23    property = window.getComputedStyle($("body")[0], "::after").getPropertyValue("content");
24    //console.log(property);
25  });
26
27  var slide_foot = $(".slide_foot li");
28  var slide_cont = $(".slide_body .slide_cont");
29  slide_foot.on("click", function () {
30    slide_foot.removeClass("current");
31    $(this).addClass("current");
32    var current_index = $(this).index();
33    slide_cont.removeClass("current");
34    slide_cont.eq(current_index).addClass("current");
35  });
36
37  //カレンダープラグイン
38  // $('#calendar').calendar();
39  // $("th").removeClass("tue");
40  // $(".next a").click(function(){
41  // 	$("th").removeClass("tue");
42  // });
43  // $(".prev a").click(function(){
44  // 	$("th").removeClass("tue");
45  // });
46});
47
48/*スマホメニューアコーディオン*/
49$(function () {
50  $("#navi .parent>p").click(function () {
51    $(this).parent().toggleClass("active");
52    $(this).next(".child").slideToggle();
53  });
54});
55
56/*ガイドアコーディオン*/
57$(function () {
58  $(".user_guide .guide_main h3").click(function () {
59    $(this).parent().toggleClass("active");
60    $(this).next("p").slideToggle();
61  });
62});
63
64/*その他ページアコーディオン*/
65$(function () {
66  $(".accordion_wrap .ac_title").click(function () {
67    $(this).parent().toggleClass("active");
68    $(this).next(".ac_inner").slideToggle();
69  });
70});
71
72/*カテゴリページもっとみるボタン*/
73$(function () {
74  $(".cate_head .more_btn").click(function () {
75    $(this).toggleClass("active");
76    $("#cate_accordion").slideToggle();
77  });
78});
79
80/*TOPスライダー*/
81/*$(function () {
82  $(".fv_slider").slick({
83    centerMode: true,
84    centerPadding: "18%",
85    slidesToShow: 1,
86    slidesToScroll: 1,
87    speed: 2000,
88    autoplaySpeed: 4000,
89    //autoplay: true,
90    //fade: true,
91    dots: true,
92    arrows: true,
93    //pauseOnFocus: false,
94    //pauseOnHover: false,
95    //pauseOnDotsHover: false,
96    //swipe: false,
97    //swipeToSlide: false,
98    responsive: [
99      {
100        breakpoint: 1200,
101        settings: {
102        centerPadding: "10%",
103        },
104      },
105      {
106        breakpoint: 992,
107        settings: {
108        centerPadding: "0%",
109        },
110      },
111    ],
112  });
113});*/
114
115/*TOPスライダー*/
116$(function () {
117  const mySwiper = new Swiper(".fv_swiper", {
118    loop: true,
119    autoplay: {
120      delay: 4000,
121    },
122    speed: 1000,
123    centeredSlides: false,
124    slidesPerView: 1,
125    breakpoints: {
126      992: {
127        slidesPerView: 1.25,
128        centeredSlides: true,
129      },
130      1200: {
131        slidesPerView: 1.56,
132        centeredSlides: true,
133      },
134    },
135    pagination: {
136      el: ".swiper-pagination",
137    },
138    navigation: {
139      nextEl: ".swiper-button-next",
140      prevEl: ".swiper-button-prev",
141    },
142  });
143});
144
145/*Aboutスライダー(メインイメージ)*/
146$(function () {
147  $(".bg_slider").slick({
148    slidesToShow: 1,
149    slidesToScroll: 1,
150    speed: 2000,
151    autoplaySpeed: 4000,
152    autoplay: true,
153    fade: true,
154    dots: false,
155    arrows: false,
156    pauseOnFocus: false,
157    pauseOnHover: false,
158    pauseOnDotsHover: false,
159    swipe: false,
160    swipeToSlide: false,
161  });
162});
163
164/*複数写真スライダー*/
165$(function () {
166  $(".photo_slider").slick({
167    slidesToShow: 1,
168    slidesToScroll: 1,
169    speed: 2000,
170    autoplaySpeed: 3000,
171    autoplay: true,
172    dots: true,
173    arrows: true,
174  });
175});
176
177/*複数写真スライダー(SPのみ)*/
178$(function () {
179  function sliderSetting() {
180    var width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
181    //console.log(width + "(1)");
182    if (width <= 768) {
183      $(".photo_slider_sp").not(".slick-initialized").slick({
184        slidesToShow: 1,
185        slidesToScroll: 1,
186        speed: 2000,
187        autoplaySpeed: 3000,
188        autoplay: true,
189        dots: true,
190        arrows: true,
191      });
192    } else {
193      $(".slide.slick-initialized").slick("unslick");
194    }
195  }
196  sliderSetting();
197  $(window).resize(function () {
198    var width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
199    //console.log(width + "(2)");
200    if (width <= 768) {
201      sliderSetting();
202    } else {
203      $(".photo_slider_sp").slick("unslick");
204    }
205  });
206});
207
208/*ランキングスライダー*/
209/*function checkBreakPoint() {
210  w = $(window).width();
211  if (w <= 767) {
212    // スマホ向け(767px以下のとき)
213    $(".ranking .column-set").not(".slick-initialized").slick({
214      //スライドさせる
215      slidesToShow: 2.3,
216      slidesToScroll: 1,
217      speed: 2000,
218      autoplay: false,
219      fade: false,
220      dots: false,
221      arrows: false,
222      pauseOnFocus: false,
223      pauseOnHover: false,
224      pauseOnDotsHover: false,
225      swipe: true,
226      swipeToSlide: true,
227      rows: 2,
228      infinite: false,
229    });
230  } else {
231    // PC向け
232    $(".ranking .column-set.slick-initialized").slick("unslick");
233  }
234}
235// ウインドウがリサイズする度にチェック
236$(window).resize(function () {
237  checkBreakPoint();
238});
239// 初回チェック
240$(function () {
241  checkBreakPoint();
242});*/
243
244/*ランキングスライダー*/
245/*$(function() {
246  var swiper;
247  //初回処理
248  var w = $(window).width();
249  if (w <= 767) {
250    $("#main section .ranking .column-set").addClass("swiper-wrapper");
251    $("#main section .ranking .column-set .column5").addClass("swiper-slide");
252    swiper = new Swiper('.ranking', {
253      slidesPerView: 2.3,
254      grid: {
255        rows: 2,
256      },
257      loop: false,
258    });
259  }
260  //リサイズでの処理
261  $(window).on('load resize', function(){
262      var w = $(window).width();
263      if (w <= 767) {
264          if (swiper) {
265              return;
266          } else {
267              $("#main section .ranking .column-set").addClass("swiper-wrapper");
268              $("#main section .ranking .column-set .column5").addClass("swiper-slide");
269              swiper = new Swiper('.ranking', {
270                slidesPerView: 2.5,
271                grid: {
272                  rows: 2,
273                },
274                loop: false,
275              });
276          }
277      } else {
278          if (swiper) {
279              swiper.destroy();
280              swiper = undefined;
281              $("#main section .ranking .column-set").removeClass("swiper-wrapper");
282          } 
283      } 
284  });
285}); */
286
287/*ランキング スマホ表示もっと見る*/
288$(function () {
289  //もっと見るボタンを追加
290  $("#main section .ranking .column-set").after('<a class="more_btn">もっと見る</a>');
291
292  //非表示にする数を設定
293  var moreNum = 6;
294  $("#main section .ranking .column-set .column5:nth-child(n + " + (moreNum + 1) + ")").addClass("is-hidden");
295
296  $("#main section .ranking .more_btn").on("click", function () {
297    if ($(this).hasClass("open")) {
298      $("#main section .ranking .column-set .column5:nth-child(n + " + (moreNum + 1) + ")").addClass("is-hidden");
299      $("#main section .ranking .more_btn").text("もっと見る");
300      $("#main section .ranking .more_btn").removeClass("open");
301    } else {
302      $("#main section .ranking .column-set .column5.is-hidden").slice(0, moreNum).removeClass("is-hidden");
303      if ($("#main section .ranking .column-set .column5.is-hidden").length == 0) {
304        $("#main section .ranking .more_btn").text("折りたたむ");
305        $("#main section .ranking .more_btn").addClass("open");
306      }
307    }
308  });
309
310  $(function () {
311    var list = $("#main section .ranking .column-set .column5").length;
312    if (list < moreNum) {
313      $("#main section .ranking .more_btn").addClass("is-btn-hidden");
314    }
315  });
316});
317
318/*TOP自動出力箇所変更*/
319$(function () {
320  //ランキング
321  $("#main section .ranking>h2").html("- RANKING -<span>人気商品</span>");
322  //お知らせ
323  $("#main section .news>h2").html("- NEWS -<span>最新情報</span>");
324});
325
326/*フッター表示変更*/
327$(window).on("load", function () {
328  if (document.URL.match(/tokushoho/) || document.URL.match(/privacypolicy/)) {
329    $(".gift_service").hide();
330    $(".user_guide").hide();
331  }
332});
333
334/*ヘッダーPCメニュー*/
335$(function () {
336  $(".has_menu > a").click(function () {
337    if ($(this).hasClass("active")) {
338      $(".has_menu > .active").next(".menu").slideUp();
339      $(".has_menu > .active").next(".menu").removeClass("active");
340      $(".has_menu > a").removeClass("active");
341    } else {
342      $(".has_menu > .active").next(".menu").slideUp();
343      $(".has_menu > .active").next(".menu").removeClass("active");
344      $(".has_menu > a").removeClass("active");
345
346      $(this).toggleClass("active");
347      $(this).next().toggleClass("active");
348      $(this).next().slideToggle();
349    }
350  });
351});
352
353/*タブ切替*/
354/*$(function () {
355  $(".tab_btn_list .tab_btn").click(function () {
356    var index = $(this).parent(".tab_btn_list").children(".tab_btn").index(this);
357    $(this).parent(".tab_btn_list").children(".tab_btn").removeClass("active");
358    $(this).parent(".tab_btn_list").next(".tab_area").children(".tab_box").removeClass("active");
359    $(this).addClass("active");
360    $(this).parent(".tab_btn_list").next(".tab_area").children(".tab_box").eq(index).addClass("active");
361  });
362});*/
363
364/*スムーススクロール*/
365$(function () {
366  $('a[href^="#"]').on("click", function () {
367    var speed = 600;
368    var header_height = $("#header").height();
369    var href = $(this).attr("href");
370    var target = $(href == "#" || href == "" ? "html" : href);
371    var position = target.offset().top - header_height;
372    $("body,html").animate({ scrollTop: position }, speed, "swing");
373    return false;
374  });
375});
376$(function () {
377  $("#search_price_btn").on("click", function () {
378    var pos = $("#search_price").offset().top;
379    var headerHeight = $("#header").outerHeight() + 20;
380    $("body,html").animate({ scrollTop: pos - headerHeight }, 600);
381    return false;
382  });
383});
384
385/*別ページへのアンカーリンク高さ調整*/
386$(window).on("load", function () {
387  const url = $(location).attr("href"),
388    headerHeight = $("#header").outerHeight() + 20;
389
390  if (url.indexOf("#") != -1) {
391    const anchor = url.split("#"),
392      target = $("#" + anchor[anchor.length - 1]),
393      position = Math.floor(target.offset().top) - headerHeight;
394    $("html, body").animate({ scrollTop: position }, 500);
395  }
396});
397
398/*ギフトラッピングページ アコーディオン部分*/
399$(function () {
400  if ($("#gift_detail").length) {
401    $("#gift_detail").load("https://o-ki.co.jp/common/giftwrapping_detail.html");
402  }
403});
404
405/*商品詳細*/
406// 要素並び替え
407$(function () {
408  $("#item_detail_top_add .item_shipping").appendTo("#pi_cart");
409  $("#item_detail_top_add .item_line").appendTo("#pi_cart");
410  $("#pi_cart #spsVarpriceBox .option_area").appendTo("#pi_cart > .spec");
411});
412// 商品画像切り替え
413$(function () {
414  $(".itemThumb-wrap .itemThumb li").click(function () {
415    var ch_img = $(this).children("img").attr("src");
416    //console.log(ch_img);
417    $(".itemThumb-wrap .itemThumb li").removeClass("active");
418    $(this).addClass("active");
419    $(".itemThumb-wrap .itemThumb-main img").attr("src", ch_img);
420  });
421});
422//お客様の声
423$(function () {
424  $(".userreview>h2").html("-お客様の声-");
425  $(".userreview>.more a").html("もっとみる");
426});
427//評価★マーク変更
428$(function () {
429  if ($(".review_txt, .userreview_rate, .reviewBox_item, .reviewTxt").length) {
430    $(".review_txt img, .userreview_rate img, .reviewBox_item ul li img, .reviewTxt ul li img").each(function () {
431      if ($(this).attr("src").indexOf("/hpgen/HPB/theme/img/rate_on.png") >= 0) {
432        $(this).attr("src", "/common/img/item/star.png");
433      }
434      if ($(this).attr("src").indexOf("/hpgen/HPB/theme/img/rate_half.png") >= 0) {
435        $(this).attr("src", "/common/img/item/star_half.png");
436      }
437    });
438  }
439});
440//文字変更
441/*$(function () {
442  $(".quantityArea th:first-child").html("購入グラム");
443  $(".option_area th:first-child").html("包装箱");
444});*/
445//包装箱ポップアップ
446$(function () {
447  $(".option_area th:first-child").append('<span class="pop_btn"></span>');
448  $(".modal_pop").hide();
449  $(".pop_btn").on("click", function () {
450    $(".modal_pop").fadeIn();
451  });
452  $(".js-modal-close").on("click", function () {
453    $(".modal_pop").fadeOut();
454  });
455  $(".modal_pop .close_btn").on("click", function () {
456    $(".modal_pop").fadeOut();
457  });
458});
459//ランキングアイコン非表示
460$(function () {
461  if ($(".ico_itemType").length) {
462    $(".ico_itemType li").each(function () {
463      if ($(this).children("img").attr("alt").indexOf("ランキング") >= 0) {
464        $(this).hide();
465      }
466    });
467  }
468});
469//カート上に要素移動
470$(function () {
471  if ($(".js-movetop").length) {
472    $(".js-movetop").insertBefore("#itemDetail-wrap.__area01");
473  }
474});
475
476/*TOPへ戻るボタン*/
477$(function () {
478  var pagetop = $("#page_top");
479  // ボタン非表示
480  pagetop.hide();
481  // 100px スクロールしたらボタン表示
482  $(window).scroll(function () {
483    if ($(this).scrollTop() > 100) {
484      pagetop.fadeIn();
485    } else {
486      pagetop.fadeOut();
487    }
488  });
489  pagetop.click(function () {
490    $("body, html").animate({ scrollTop: 0 }, 500);
491    return false;
492  });
493});
494
495/*FV固定デザイン*/
496function stickyBackground() {
497  var header_height = $("#header").height();
498  $(".sticky_bg").css("top", header_height);
499}
500// ウインドウがリサイズする度にチェック
501$(window).resize(function () {
502  stickyBackground();
503});
504// 初回チェック
505$(function () {
506  stickyBackground();
507});
508$(function () {
509  var window_height = $(window).height();
510  var noneItem = $(".js_scroll_none");
511  $(window).scroll(function () {
512    if ($(this).scrollTop() > window_height / 1.5) {
513      noneItem.fadeOut();
514    } else {
515      noneItem.fadeIn();
516    }
517  });
518});
519
520/*商品一覧ページ*/
521$(function () {
522  //URLに特定の文字が含まれている場合
523  if (document.URL.match(/itemlist/)) {
524    $("#itemList_wrap").prepend(
525      '\
526      <div class="cate_head">\
527        <div class="cate_head_img">\
528          <img src="common/img/category/head_itemlist_pc.jpg" alt="商品一覧" class="pc_only">\
529          <img src="common/img/category/head_itemlist.jpg" alt="商品一覧" class="sp_only">\
530        </div>\
531        <div class="cate_head_text">\
532          <h2>商品一覧</h2>\
533        </div>\
534      </div>\
535    ',
536    );
537  }
538
539  //本番用
540  //var url = location.href;
541  //if(url == 'https://o-ki.co.jp/SHOP/list.php'){
542  if (document.URL.match(/list.php/)) {
543    var searchWord = getParam("Search");
544    if (searchWord == null || searchWord == "") {
545      $("#itemList_wrap").prepend(
546        '\
547          <div class="cate_head">\
548            <div class="cate_head_img">\
549              <img src="/common/img/category/head_itemlist.jpg" alt="商品一覧" class="pc_only">\
550              <img src="/common/img/category/head_itemlist.jpg" alt="商品一覧" class="sp_only">\
551            </div>\
552            <div class="cate_head_text">\
553              <h2>商品一覧</h2>\
554            </div>\
555          </div>\
556        ',
557      );
558    } else {
559      $("#itemList_wrap").prepend(
560        '\
561          <div class="cate_head">\
562            <div class="cate_head_img">\
563              <img src="/common/img/category/head_itemlist.jpg" alt="商品一覧" class="pc_only">\
564              <img src="/common/img/category/head_itemlist.jpg" alt="商品一覧" class="sp_only">\
565            </div>\
566            <div class="cate_head_text">\
567              <h2>"' +
568          searchWord +
569          '"の検索結果</h2>\
570            </div>\
571          </div>\
572        ',
573      );
574    }
575  }
576
577  //検索ワード抽出
578  function getParam(name, url) {
579    if (!url) url = window.location.href;
580    name = name.replace(/[\[\]]/g, "\\$&");
581    var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
582      results = regex.exec(url);
583    if (!results) return null;
584    if (!results[2]) return "";
585    return decodeURIComponent(results[2].replace(/\+/g, " "));
586  }
587});
588
589/*特商法ページフッターのガイド非表示*/
590$(function () {
591  var url = location.href;
592  if (url == "https://o-ki.co.jp/hpgen/HPB/shop/business.html") {
593    $(".gift_service").hide();
594    $(".user_guide").hide();
595  }
596});
597
598/*頒布会ページ*/
599//頒布会ページ プラン詳細部分読み込み
600$(function () {
601  if ($("#hanpu_detail").length) {
602    $("#hanpu_detail").load("https://o-ki.co.jp/common/hanpu_detail.html");
603  }
604});
605//メニュー一覧スマホ表示スライダー
606$(function () {
607  let swipersItems = [];
608  const breakPoint = 768;
609  let swipers = document.querySelectorAll(".menu_list_swiper");
610  var swiperSlide = $(".menu_list_swiper .menu_list_wrap");
611  var flag = 0;
612  window.addEventListener(
613    "load",
614    () => {
615      const options = {
616        loop: true,
617        autoplay: true,
618        speed: 1000,
619        pagination: {
620          el: ".swiper-pagination",
621        },
622      };
623      // IDを格納
624      swipers.forEach((element, index) => {
625        if (window.innerWidth <= breakPoint) {
626          do {
627            swiperSlide.children(".hanpu_menu:lt(4)").wrapAll('<div class="sp_wrap swiper-slide"></div>');
628          } while (swiperSlide.children(".hanpu_menu").length);
629          swipersItems[index] = new Swiper("#" + element.id, options);
630        } else {
631          swipersItems[index] = undefined;
632        }
633      });
634      window.addEventListener(
635        "resize",
636        () => {
637          swipers.forEach((element, index) => {
638            if (window.innerWidth <= breakPoint) {
639              do {
640                swiperSlide.children(".hanpu_menu:lt(4)").wrapAll('<div class="sp_wrap swiper-slide"></div>');
641              } while (swiperSlide.children(".hanpu_menu").length);
642              if (swipersItems[index] === undefined) {
643                swipersItems[index] = new Swiper("#" + element.id, options);
644              }
645              flag = 0;
646            } else {
647              if (swipersItems[index] !== undefined) {
648                swipersItems[index].destroy();
649                swipersItems[index] = undefined;
650              }
651              flag = 1;
652            }
653            return;
654          });
655          if (flag == 1) {
656            $(".sp_wrap").each(function () {
657              $(this).children(".hanpu_menu:first-child").unwrap();
658            });
659          }
660        },
661        false,
662      );
663    },
664    false,
665  );
666});
667//コースタブ切り替え
668$(function () {
669  var tabTarget = $(".hanpu_course .tab_area .tab");
670  var selectAll = $(".hanpu_course .tab_area .tab, .hanpu_course .content_area .content");
671  var tabContent = $(".hanpu_course .content_area .content");
672  tabTarget.on("click", function () {
673    selectAll.removeClass("active");
674    $(this).addClass("active");
675    var index = tabTarget.index(this);
676    tabContent.eq(index).addClass("active");
677  });
678});
679//メニュー切り替え
680$(function () {
681  var tabTarget = $(".hanpu_menu_list .menu_list .menu_list_wrap .hanpu_menu");
682  tabTarget.on("click", function () {
683    var tabContent = $(this).parents(".hanpu_menu_list").find(".menu_detail>ul>li");
684    var num = $(this).attr("datanum") - 1;
685
686    tabContent.removeClass("active");
687    $(this).addClass("active");
688    tabContent.eq(num).addClass("active");
689    $("html,body").animate({ scrollTop: $(this).parents(".hanpu_menu_list").find(".menu_detail").offset().top - $("#header").height() });
690  });
691});
692//メニュー一覧文字数制限
693$(function () {
694  var count = 18;
695  $(".hanpu_menu_list .menu_list .menu_list_wrap .hanpu_menu .name").each(function () {
696    var thisText = $(this).text();
697    var textLength = thisText.length;
698    if (textLength > count) {
699      var showText = thisText.substring(0, count);
700      var insertText = (showText += "…");
701      $(this).html(insertText);
702    }
703  });
704});
705//よくあるご質問アコーディオン
706$(function () {
707  $(".hanpu_faq .faq_list dl dt").click(function () {
708    $(this).toggleClass("active");
709    $(this).next("dd").slideToggle();
710  });
711});
712
713/*お中元ページ*/
714//お中元ページコンテンツ読み込み
715$(function () {
716  if ($("#summer_gift_detail").length) {
717    $("#summer_gift_detail").load("https://o-ki.co.jp/common/summer_gift_detail.html");
718  }
719});
720/*お歳暮ページ*/
721//お歳暮ページコンテンツ読み込み
722$(function () {
723  if ($("#yearend_gift_detail").length) {
724    $("#yearend_gift_detail").load("https://o-ki.co.jp/common/yearend_gift_detail.html");
725  }
726});
727/*お年賀ページ*/
728//お年賀ページコンテンツ読み込み
729$(function () {
730  if ($("#newyear_detail").length) {
731    $("#newyear_detail").load("https://o-ki.co.jp/common/newyear_detail.html");
732  }
733});
734/*入学祝ページ*/
735//入学祝ページコンテンツ読み込み
736$(function () {
737  if ($("#admission_detail").length) {
738    $("#admission_detail").load("https://o-ki.co.jp/common/admission_detail.html");
739  }
740});
741/*父の日ページ*/
742//父の日ページコンテンツ読み込み
743$(function () {
744  if ($("#fathersday_detail").length) {
745    $("#fathersday_detail").load("https://o-ki.co.jp/common/fathersday_detail.html");
746  }
747});
748//商品別ランキングタブ切り替え
749$(function () {
750  var tabTarget = $(".summer_gift_ranking .tab_area .tab");
751  var selectAll = $(".summer_gift_ranking .tab_area .tab, .summer_gift_ranking .content_area .content");
752  var tabContent = $(".summer_gift_ranking .content_area .content");
753  tabTarget.on("click", function () {
754    selectAll.removeClass("active");
755    $(this).addClass("active");
756    var index = tabTarget.index(this);
757    tabContent.eq(index).addClass("active");
758  });
759});
760//価格帯別タブ切り替え
761$(function () {
762  var tabTarget = $(".summer_gift_price .tab_area .tab");
763  var selectAll = $(".summer_gift_price .tab_area .tab, .summer_gift_price .content_area .content");
764  var tabContent = $(".summer_gift_price .content_area .content");
765  tabTarget.on("click", function () {
766    selectAll.removeClass("active");
767    $(this).addClass("active");
768    var index = tabTarget.index(this);
769    tabContent.eq(index).addClass("active");
770  });
771});
772//カタログギフトタブ切り替え
773$(function () {
774  var tabTarget = $(".summer_gift_catalog .tab_area .tab");
775  var selectAll = $(".summer_gift_catalog .tab_area .tab, .summer_gift_catalog .content_area .content");
776  var tabContent = $(".summer_gift_catalog .content_area .content");
777  tabTarget.on("click", function () {
778    selectAll.removeClass("active");
779    $(this).addClass("active");
780    var index = tabTarget.index(this);
781    tabContent.eq(index).addClass("active");
782  });
783});
784//カタログギフト スマホスライダー
785$(function () {
786  let swipersItems = [];
787  const breakPoint = 768;
788  let swipers = document.querySelectorAll(".catalog_swiper");
789  window.addEventListener(
790    "load",
791    () => {
792      const options = {
793        slidesPerView: 2.1,
794        spaceBetween: 15,
795        loop: false,
796        //autoplay: true,
797        speed: 1000,
798        pagination: {
799          el: ".swiper-pagination",
800          clickable: true,
801        },
802        breakpoints: {
803          576: {
804            slidesPerView: 2.5,
805          },
806        },
807      };
808      // IDを格納
809      swipers.forEach((element, index) => {
810        if (window.innerWidth <= breakPoint) {
811          swipersItems[index] = new Swiper("#" + element.id, options);
812        } else {
813          swipersItems[index] = undefined;
814        }
815      });
816      window.addEventListener(
817        "resize",
818        () => {
819          swipers.forEach((element, index) => {
820            if (window.innerWidth <= breakPoint) {
821              if (swipersItems[index] === undefined) {
822                swipersItems[index] = new Swiper("#" + element.id, options);
823              }
824            } else {
825              if (swipersItems[index] !== undefined) {
826                swipersItems[index].destroy();
827                swipersItems[index] = undefined;
828              }
829            }
830            return;
831          });
832        },
833        false,
834      );
835    },
836    false,
837  );
838});
839
840//TOP 米沢牛黄木についてアコーディオン
841$(function () {
842  $(".philosophy_more_text .more_btn").click(function () {
843    $(this).toggleClass("active");
844    if ($(this).hasClass("active")) {
845      $(this).children(".btn").text("折りたたむ");
846    } else {
847      $(this).children(".btn").text("もっとみる");
848    }
849    $(this).prev(".more_text").slideToggle();
850  });
851});
852
853// TOP 最新情報もっと見る追加
854$(function () {
855  //もっと見るボタンを追加
856  $("#main section .news .news-contents").after('<div class="more_btn"><a href="/hpgen/HPB/entries/159.html">新着情報一覧</a></div>');
857});
858
859// リダイレクト
860$(function () {
861  // 現在のURLを取得
862  var currentUrl = window.location.href;
863
864  // 特定のURLをチェック
865  if (currentUrl.includes("/hpgen/HPB/shop/sitemap.html")) {
866    // リダイレクトするURLに変更
867    window.location.href = "/";
868  }
869  if (currentUrl.includes("/hpgen/HPB/shop/shoppinguide.html")) {
870    // リダイレクトするURLに変更
871    window.location.href = "/hpgen/HPB/entries/5.html#sec02";
872  }
873  if (currentUrl.includes("/hpgen/HPB/categories/23029.html")) {
874    // リダイレクトするURLに変更
875    window.location.href = "/";
876  }
877  if (currentUrl.includes("/hpgen/HPB/categories/23009.html")) {
878    // リダイレクトするURLに変更
879    window.location.href = "/SHOP/379126/list.html";
880  }
881  if (currentUrl.includes("/hpgen/HPB/categories/25278.html")) {
882    // リダイレクトするURLに変更
883    window.location.href = "/SHOP/YIG-001.html";
884  }
885});
886
887// TOPランキング カートボタン追加
888$(function () {
889  $(".ranking .column5").each(function () {
890    var $column = $(this);
891
892    // 商品ページのリンクから商品番号を取得
893    var href = $column.find("h3 a, .itemThumb a").first().attr("href");
894
895    if (href) {
896      var match = href.match(/\/SHOP\/([^\/]+)\.html$/i);
897
898      if (match) {
899        var itemNo = match[1];
900
901        // カートボタンを作成
902        var $cartBtn = $("<a>", {
903          href: "https://o-ki.co.jp/CART/cart.php?ITM=" + itemNo + "&CNT=1",
904          text: "カートに入れる",
905          class: "cart-btn",
906        });
907
908        // .column5 の最後に追加
909        $column.append($cartBtn);
910      }
911    }
912  });
913});
914
915// 商品ページ 固定カートボタン
916$(function () {
917  if ($(".fix_cart_area").length) {
918    $(".shopping_form").clone(true).appendTo(".fix_cart_area");
919  }
920});

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.