PageSourceSearch

https://www.kenko-bi.jp/mybeauty/wp/wp-content/themes/kenko/js/javascript.js?ver=20220424-004

js kenko-bi.jp collected 2026-10-04 18:36:17 UTC 4,687 bytes, 180 lines download raw bytes

1/*===================================
2固定ヘッダースクロール
3===================================*/
4function smoothScroll(smoothSpeed, fixedElem){
5var headerHeight;
6if(arguments.length === 1){
7headerHeight = 0;
8}else if(arguments.length === 2){
9headerHeight = $(".js-fixScroll").height();
10var timer = false;
11$(window).resize(function() {
12if (timer !== false) {
13clearTimeout(timer);
14}
15timer = setTimeout(function() {
16headerHeight = $(".js-fixScroll").height();
17}, 200);
18});
19}else{
20throw new Error('');
21}
22$('a[href^="#"]').click(function(){
23var speed = smoothSpeed;
24var href= $(this).attr("href");
25var target = $(href == "#" || href == "" ? 'html' : href);
26var position = target.offset().top;
27$("html, body").animate({scrollTop:position - headerHeight}, speed, "swing");
28return false;
29});
30}
31$(function(){
32smoothScroll(500, "#sample");
33});
34
35
36/*===================================
37スムーズスクロール
38===================================*/
39/*
40$(function(){
41$('a[href^="#"]').click(function(){
42var adjust = 0;
43var speed = 400;
44var href= $(this).attr("href");
45var target = $(href == "#" || href == "" ? 'html' : href);
46var position = target.offset().top + adjust;
47$('body,html').animate({scrollTop:position}, speed, 'swing');
48return false;
49});
50});
51*/
52
53
54/*===================================
55ブラウザサイズ iOS対策
56===================================*/
57$(document).ready(function () {
58var hSize = $(window).height();
59$(".js-fvHeight").height(hSize); // ブラウザの縦のサイズを取得
60});
61$(window).resize(function () { // ページをリサイズした時の処理
62var hSize = $(window).height();
63$(".js-fvHeight").height(hSize); // ブラウザの縦のサイズを取得
64});
65
66
67/*===================================
68スクロールでclass付与
69===================================*/
70$(window).scroll(function(){
71var element = $('.js-getHeight'),
72scroll = $(window).scrollTop(),
73height = element.outerHeight();
74if ( scroll > height ) {
75$('.js-addClass').addClass('is-active');
76} else {
77$('.js-addClass').removeClass('is-active');
78}
79});
80
81
82/*===================================
83ハンバーガーメニュー
84===================================*/
85$(function() {
86$('.js-gnavToggle').click(function() {
87$('.js-gnav').toggleClass('is-active');
88if ($('.js-gnav').hasClass('is-active')) {
89$('.js-gnavOpen').fadeToggle();
90}	else {
91$('.js-gnavOpen').fadeToggle();}});
92$('.js-gnavOpen a[href*="#"],.js-gnavClose').click(function() {
93$('.is-active .js-gnavToggle').trigger('click');
94});
95});
96
97
98/*===================================
99タブ
100===================================*/
101jQuery(function($){
102$('.js-tabBtn').click(function(){
103$('.is-tabActive').removeClass('is-tabActive');
104$(this).addClass('is-tabActive');
105$('.is-tabShow').removeClass('is-tabShow');
106const index = $(this).index();
107$('.js-tabContent').eq(index).addClass('is-tabShow');
108});
109});
110
111/*===================================
112公式限定セット用タブ
113===================================*/
114jQuery(function($){
115  const $root = $('.p-products_01');
116  if (!$root.length) return;
117  function syncHeadContent() {
118    const label = $root.find('.js-tabBtn.is-tabActive').text().trim();
119    const map = {
120      "公式限定セット": "280g×2袋",
121      "単品購入": "280g/14食分"
122    };
123    $root.find('.p-productsDetailHead__content').text(map[label]);
124  }
125  $root.find('.js-tabBtn').on('click', function(){
126    $root.find('.is-tabActive').removeClass('is-tabActive');
127    $(this).addClass('is-tabActive');
128    $root.find('.is-tabShow').removeClass('is-tabShow');
129    const index = $(this).index();
130    $root.find('.js-tabContent').eq(index).addClass('is-tabShow');
131    syncHeadContent();
132  });
133});
134
135
136/*===================================
137アコーディオン
138===================================*/
139$(function(){
140$('.js-accordion .js-toggle').click(function(){
141$(this).next('.js-accordion .js-content').stop().slideToggle('fast');
142$(this).parent('.js-accordion').toggleClass('is-active');
143});
144});
145
146
147/*===================================
148モーダルウィンドウ(テキストのみ)
149===================================*/
150$(function(){
151$('.js-modal-open').each(function(){
152$(this).on('click',function(){
153var target = $(this).data('target');
154var modal = document.getElementById(target);
155$(modal).fadeIn();
156return false;
157});
158});
159$('.js-modal-close').on('click',function(){
160$('.js-modal').fadeOut();
161return false;
162});
163});
164
165
166/*===================================
167ページトップ
168===================================*/
169$(function () {
170var topBtn = $('.js-pagetop');
171topBtn.hide();
172$(window).scroll(function () {
173if ($(this).scrollTop() > 500) {
174topBtn.fadeIn();
175} else {
176topBtn.fadeOut();
177}
178});
179});
180

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.