PageSourceSearch

https://www.kyoeisha.com/wp-content/themes/kyoeisha2022/js/custom.js?ver=7.1.3&t=1791344234

js kyoeisha.com collected 2026-10-07 03:37:33 UTC 12,905 bytes, 405 lines download raw bytes

1//viewport
2if ((navigator.userAgent.indexOf('iPhone') > 0) || navigator.userAgent.indexOf('Android') > 0) {
3	document.write('<meta name="viewport" content="width=device-width">');
4} else if (navigator.userAgent.indexOf('iPod') > 0 ) {
5	document.write('<meta name="viewport" content="width=1200">');
6} else {
7	document.write('<meta name="viewport" content="width=device-width">');
8}
9$(document).ready(function(){
10  
11  //カレント設定
12	var id = $("body").attr("id");
13	$("li." + id).addClass("active");
14  
15  //現在のURLを取得しog:urlに挿入
16	var href = document.URL;
17	$("meta[property='og:url']").attr("content",href);
18  
19  //電話番号にリンクを追加
20  var ua = navigator.userAgent;
21  //テキストの場合
22  if(ua.indexOf('iPhone') > 0 && ua.indexOf('iPod') == -1 || ua.indexOf('Android') > 0 && ua.indexOf('Mobile') > 0 && ua.indexOf('SC-01C') == -1 && ua.indexOf('A1_07') == -1 ){
23    $('.tel-link').each(function(){
24      var str = $(this).text();
25      $(this).html($('<a>').attr('href', 'tel:' + str.replace(/-/g, '')).append(str + '</a>'));
26    });
27  }
28  //画像の場合
29  if(ua.indexOf('iPhone') > 0 && ua.indexOf('iPod') == -1 || ua.indexOf('Android') > 0 && ua.indexOf('Mobile') > 0 && ua.indexOf('SC-01C') == -1 && ua.indexOf('A1_07') == -1 ){
30    $('.img-tel-link img').each(function(){
31      var alt = $(this).attr('alt');
32      $(this).wrap($('<a>').attr('href', 'tel:' + alt.replace(/-/g, '')));
33    });
34  }
35  
36  //メールアドレススパム防止
37  $('.email').each(function(i) {
38    var mail = $(this).html();
39    //置換文字の指定
40    mail = mail.replace(" [at] ", "@");
41    mail = mail.replace(" [dot] ", ".");
42    //mailtoリンクに含める
43    $(this).html(mail).replaceWith("<a href=\"mailto:" + $(this).text() + "\">" + $(this).text() + "</a>");
44  });
45  
46  //メニュー
47    $(".l_nav_button").click(function(){
48      $(this).toggleClass("active");
49      $("#l_nav_content").toggleClass("active");
50    });
51});
52
53//スムーススクロール
54$(function(){
55  $('a[href^="#"]').click(function() {
56  var speed = 400; 
57  var href= $(this).attr("href");
58  var target = $(href == "#" || href == "" ? 'html' : href);
59  var position = target.offset().top;
60  $('body,html').animate({scrollTop:position}, speed, 'swing');
61  return false;
62  });
63});
64
65//実績スライダー
66$(function(){
67  $(".owl-carousel").owlCarousel({
68    items: 3,
69    margin: 20,
70    loop: true,
71    dots:true,
72    autoplay: true,
73    autoPlaySpeed: 5000,
74    autoPlayTimeout: 5000,
75    autoplayHoverPause: true,
76  });
77});
78//$(function(){
79//  $(".u_pc_view .owl-carousel").owlCarousel({
80//    items: 3,
81//    margin: 20,
82//    loop: true,
83//    dots:true,
84//    autoplay: true,
85//    autoPlaySpeed: 5000,
86//    autoPlayTimeout: 5000,
87//    autoplayHoverPause: true,
88//  });
89//});
90//$(function(){
91//  $(".u_sp_view .owl-carousel").owlCarousel({
92//    items: 1,
93//    loop: true,
94//    dots:true,
95//    autoplay: true,
96//    autoPlaySpeed: 5000,
97//    autoPlayTimeout: 5000,
98//    autoplayHoverPause: true,
99//    stagePadding: 100,
100//  });
101//});
102
103//ヘッダースクロールボタン
104$(function(){
105  if($("#top").length) {
106    var scrollend = $('#l_about_area').offset().top ; //ページ上部からの距離を取得
107    var distance = 0;
108    $(document).scroll(function(){
109      distance = $(this).scrollTop(); //スクロールした距離を取得
110      if (scrollend <= distance) {
111        $('.l_header_scroll').fadeOut();
112      } else{
113        $('.l_header_scroll').fadeIn();
114      }
115    });
116  }
117});
118
119
120//ページトップ
121$(document).ready(function(){
122    $(".l_pagetop").hide();
123    $(window).on("scroll", function() {
124        if ($(this).scrollTop() > 100) {
125            $(".l_pagetop").fadeIn("fast");
126        } else {
127            $(".l_pagetop").fadeOut("fast");
128        }
129        scrollHeight = $(document).height(); //ドキュメントの高さ 
130        scrollPosition = $(window).height() + $(window).scrollTop(); //現在地 
131        footHeight = $("footer").innerHeight(); //footerの高さ(=止めたい位置)
132        if ( scrollHeight - scrollPosition  <= footHeight ) { //ドキュメントの高さと現在地の差がfooterの高さ以下になったら
133            $(".l_pagetop").css({
134                "position":"absolute", //pisitionをabsolute(親:wrapperからの絶対値)に変更
135                "bottom": footHeight //下からfooterの高さ + 20px上げた位置に配置
136            });
137        } else { //それ以外の場合は
138            $(".l_pagetop").css({
139                "position":"fixed", //固定表示
140                "bottom": "20px" //下から20px上げた位置に
141            });
142        }
143    });
144    $('.l_pagetop').click(function () {
145        $('body,html').animate({
146        scrollTop: 0
147        }, 400);
148        return false;
149    });
150});
151//ページトップSP
152$(function() {
153	var topBtn = $('.l_pagetop_sp');
154	topBtn.hide();
155	$(window).scroll(function () {
156		if ($(this).scrollTop() > 100) {
157			topBtn.fadeIn();
158		} else {
159			topBtn.fadeOut();
160		}
161	});
162    topBtn.click(function () {
163		$('body,html').animate({
164			scrollTop: 0
165		}, 500);
166		return false;
167    });
168});
169
170
171//フェードイン左
172var window_h = $(window).height();
173$(window).on("scroll", function() {
174  var scroll_top = $(window).scrollTop();
175  $(".fadein_l").each(function() {
176    var elem_pos = $(this).offset().top;
177    if (scroll_top >= elem_pos - window_h + 100) {
178      $(this).addClass("fadein_l_m");
179    }
180  });
181});
182
183
184//フェードイン右
185var window_h = $(window).height();
186$(window).on("scroll", function() {
187  var scroll_top = $(window).scrollTop();
188  $(".fadein_r").each(function() {
189    var elem_pos = $(this).offset().top;
190    if (scroll_top >= elem_pos - window_h + 100) {
191      $(this).addClass("fadein_r_m");
192    }
193  });
194});
195
196//背景フェードイン
197$(function(){
198  $(window).scroll(function (){
199    $('.u_bg_type01 , .u_bg_type02').each(function(){
200      //要素の位置の取得
201      var target = $(this).offset().top;
202      //スクロール量を取得
203      var scroll = $(window).scrollTop();
204      //ウィンドウの高さを取得
205      var windowHeight = $(window).height();
206      //目的の要素が画面内に少し入ったらクラスを付与する
207      if (scroll > target - windowHeight + 100){
208          $(this).addClass('u_bg_fade');
209      }
210    });
211  });
212});
213
214//商品画像スライダー
215$(function(){
216  $('.gallery').slick({
217	infinite: false, //スライドをループさせるかどうか。初期値はtrue。
218	fade: true, //フェードの有効化
219	arrows: false,//左右の矢印あり
220	prevArrow: '<div class="slick-prev"></div>',//矢印部分PreviewのHTMLを変更
221	nextArrow: '<div class="slick-next"></div>',//矢印部分NextのHTMLを変更
222});
223
224//選択画像の設定
225$('.choice-btn').slick({
226	infinite: false, //スライドをループさせるかどうか。初期値はtrue。
227	slidesToShow: 5, //表示させるスライドの数
228	focusOnSelect: true, //フォーカスの有効化
229	asNavFor: '.gallery', //連動させるスライドショーのクラス名
230  arrows: true,
231  prevArrow: '<img src="https://www.kyoeisha.com/wp-content/themes/kyoeisha2022/images/icon_arrow_lft.png" class="slide-arrow prev-arrow">',
232  nextArrow: '<img src="https://www.kyoeisha.com/wp-content/themes/kyoeisha2022/images/icon_arrow_rig.png" class="slide-arrow next-arrow">',
233});
234  
235//下の選択画像をスライドさせずに連動して変更させる設定。
236$('.gallery').on('beforeChange', function(event, slick, currentSlide, nextSlide) {
237	var index = nextSlide; //次のスライド番号
238	//サムネイルのslick-currentを削除し次のスライド要素にslick-currentを追加
239	$(".choice-btn .slick-slide").removeClass("slick-current").eq(index).addClass("slick-current");
240});
241});
242
243//TOPスライダー
244$(function(){
245    var setImg = '.l_about_photo';
246    var fadeSpeed = 1600;
247    var switchDelay = 5000;
248
249    $(setImg).children('img').css({opacity:'0'});
250    $(setImg + ' img:first').stop().animate({opacity:'1',zIndex:'20'},fadeSpeed);
251
252    setInterval(function(){
253        $(setImg + ' :first-child').animate({opacity:'0'},fadeSpeed).next('img').animate({opacity:'1'},fadeSpeed).end().appendTo(setImg);
254    },switchDelay);
255});
256$(function(){
257    var setImg = '.l_about_photo_02';
258    var fadeSpeed = 1600;
259    var switchDelay = 5000;
260
261    $(setImg).children('img').css({opacity:'0'});
262    $(setImg + ' img:first').stop().animate({opacity:'1',zIndex:'20'},fadeSpeed);
263
264    setInterval(function(){
265        $(setImg + ' :first-child').animate({opacity:'0'},fadeSpeed).next('img').animate({opacity:'1'},fadeSpeed).end().appendTo(setImg);
266    },switchDelay);
267});
268
269//ホイールスクロール
270//$(function(){
271//  window.addEventListener('load', function(){
272//    if (window.matchMedia('(min-width: 640px)').matches){
273//      $.scrollify({
274//        section:'.scrollify', //対象要素を指定
275//        easing: 'swing', // イージングを指定
276//        setHeights: false,
277//        scrollSpeed: 800, // スクロール時の速度
278//        updateHash: false, // スクロール時アドレスバーのURLを更新
279//        overflowScroll: true,
280//      });
281//    }
282//  });
283//});  
284//window.onscroll = function() {
285//  if ($(window).scrollTop() === 0) {
286//    $.scrollify({
287//      section:'.scrollify',
288//      easing: 'swing',
289//      setHeights: false,
290//      scrollSpeed: 800,
291//      updateHash: false,
292//      overflowScroll: true,
293//    });    
294//  }
295//}
296
297//アコーディオン
298$(function(){
299  if(window.matchMedia("(max-width: 640px)").matches){
300    
301    $(".box01 .is_balloon_sp").show();
302    $('.l_avc_flow .box01').click(function(){
303        $('.box01 .is_balloon_sp').slideToggle();
304        $(".box01 .l_tap_icon").toggleClass("open");
305    });
306    $('.l_avc_flow .box02').click(function(){
307        $('.box02 .is_balloon_sp').slideToggle();
308        $(".box02 .l_tap_icon").toggleClass("open");
309    });
310    $('.l_avc_flow .box03').click(function(){
311        $('.box03 .is_balloon_sp').slideToggle();
312        $(".box03 .l_tap_icon").toggleClass("open");
313    });
314    $('.l_avc_flow .box04').click(function(){
315        $('.box04 .is_balloon_sp').slideToggle();
316        $(".box04 .l_tap_icon").toggleClass("open");
317    });
318  }
319});
320
321$(function(){
322  $(".box02, .box03, .box04").hover(
323  function () {
324  $(".box01, .box02").addClass("hidden");
325  },
326  function () {
327  $(".box01, .box02").removeClass("hidden");
328  }
329  );
330});
331//$(function(){
332//  if (window.matchMedia( "(max-width: 640px)" ).matches) {
333//    $(".box01").click(function(){
334//      $(".is_balloon_sp").toggleClass("open");
335//    })
336//  }
337//});
338
339$(function(){
340  $('.matchHeight').matchHeight();
341});
342
343$(function() {
344      $('.slider').slick({
345        autoplay: true,//自動でスライドさせる
346        autoplaySpeed: 4000,//次の画像に切り替えるまでの時間 今回の場合は0
347        speed: 1000,//画像が切り替わるまでの時間 今回の場合は難病で1枚分動くか
348        infinite: true, // 無限スライド
349        arrows:false,//左右に出る矢印を非表示
350        swipe: true,//スワイプ
351        swipeToSlide: true,
352        pauseOnFocus: false,//フォーカスが合っても止めない
353        pauseOnHover: false,//hoverしても止めない
354        variableWidth: true,//スライドの要素の幅をcssで設定できるようにする
355        arrows: true,//左右の矢印
356        prevArrow:'<button class="slick-prev" aria-label="Previous" type="button"></button>',nextArrow:'<button class="slick-next" aria-label="Next" type="button"></button>',
357      });
358  });
359
360  //MV Youtube
361  var tag = document.createElement("script");
362  tag.src = "https://www.youtube.com/iframe_api";
363  var firstScriptTag = document.getElementsByTagName("script")[0];
364  firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
365
366  let player;
367  function onYouTubeIframeAPIReady() {
368    player = new YT.Player("youtube", { // youtbeの箇所はHTMLのid
369      videoId: "VteOg35EmXs", // YouTubeの動画のID
370      playerVars: {
371        playsinline: 1, // インライン再生
372        autoplay: 1, // 自動再生
373        fs: 0, // 全画面表示ボタン
374        rel: 0, // 関連動画
375        controls: 0, // コントロール
376        modestbranding: 1, // YouTubeロゴ
377        iv_load_policy: 3, // 注釈
378      },
379      events: {
380        onReady: onPlayerReady,
381        onStateChange: onPlayerStateChange,
382      },
383    });
384  }
385
386  // ミュートで再生
387  function onPlayerReady(event) {
388    event.target.mute();
389    event.target.playVideo();
390  }
391
392  // 最後まで再生した後のループ再生
393  function onPlayerStateChange(event) {
394    if (event.data == YT.PlayerState.ENDED) {
395      event.target.playVideo();
396    }
397  }
398
399$(window).load(function () {
400    "use strict";
401    $('.slider').bind('touchstart', function(){
402      return true;
403    });
404});
405

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.