PageSourceSearch

https://www.foodway.co.jp/js/common.js

js foodway.co.jp collected 2026-10-02 14:31:27 UTC 4,100 bytes, 123 lines download raw bytes

1//内部リンクスクロール[pageTop]
2jQuery(function($){
3	$('a[href^="#"]').click(function() {
4    	// クリックした要素のhref属性の値を取得
5 		var anchor = $(this).attr("href");
6        // 表示位置を取得
7 		var position = $(anchor).offset().top-20;
8        // アニメーションの効果の作成
9 		$('body,html').animate({ scrollTop : position }, 500, 'swing');
10 		return false;
11	});
12});
13
14//#bnr_scroll
15$(function (){
16	var scrollStart = $('.start').offset().top; //ページ上部からの距離を取得
17	var scrollEnd = $('.end').offset().top; //ページ上部からの距離を取得
18	var windowHeight = $(window).height(); //ウインドウの高さを取得
19	var distance = 0;
20
21	$(document).scroll(function(){
22	 distance = $(this).scrollTop(); //スクロールした距離を取得
23
24	 if (scrollStart < distance) { //スクロール距離がstartの位置を超えたら(以下「<=」から変更)
25	 $('.start').addClass('fixed'); //fixedというclassを追加
26 } else if (scrollStart >= distance) { //スクロールがページ上部まで戻ったら
27	 $('.start').removeClass('fixed'); //classを削除
28	 }
29
30	 if (scrollEnd < distance + windowHeight) { //スクロール距離がendの位置を超えたら(以下「<=」「windowHeight/2」から変更)
31	 $('.start').fadeOut(); //フェードアウト
32	 } else{
33	 $('.start').fadeIn(); //endより上部に戻ったらフェードイン
34	 }
35	});
36});
37
38//youtube
39$(function() {
40  //Mobile判定
41  var mobile = false;
42  var ua = navigator.userAgent;
43  if (
44    ua.indexOf("iPhone") > 0 ||
45    ua.indexOf("iPod") > 0 ||
46    ua.indexOf("iPad") > 0 ||
47    (ua.indexOf("Android") > 0 && ua.indexOf("Mobile") > 0)
48  ) {
49    mobile = true;
50  }
51  //スマホの場合muted属性追加
52  if (mobile) {
53    $("iframe").each(function() {
54      $(this).attr("muted", "");
55    });
56  }
57  $(".thumb").click(function() {
58    var player = $(this).next("iframe")[0].contentWindow;
59    player.postMessage('{"event":"command","func":"playVideo","args":""}', "*");
60    $(this).hide();
61  });
62});
63
64//Toggle
65$(function () {
66	$('.toggle').on('click', function() {
67		$(this).toggleClass('open');
68		$(this).next('.toggle_area').slideToggle();
69	});
70});
71
72//.submit_check
73$(function() {
74
75  function checkSubmit() {
76    if ($('#check-1').prop('checked')) {
77      $('.submit_check').prop('disabled', false);
78    } else {
79      $('.submit_check').prop('disabled', true);
80    }
81  }
82
83  checkSubmit(); // ← 初期状態チェック
84
85  $('#check-1').on('click', function() {
86    checkSubmit();
87  });
88
89});
90
91
92//SP nav
93$(function () {
94	$('#viewport_nav').on('click', function() {
95		$(this).toggleClass('open');
96		$(this).next('.sp_nav').slideToggle();
97	});
98});
99
100//Slick [.top_contents #fv .slider]
101$(function () {
102	$('.slider').slick({
103	    fade:true,//切り替えをフェードで行う。初期値はfalse。
104	    autoplay: true,//自動的に動き出すか。初期値はfalse。
105	    autoplaySpeed: 3000,//次のスライドに切り替わる待ち時間
106	    speed:1000,//スライドの動きのスピード。初期値は300。
107	    infinite: true,//スライドをループさせるかどうか。初期値はtrue。
108	    slidesToShow: 1,//スライドを画面に3枚見せる
109	    slidesToScroll: 1,//1回のスクロールで3枚の写真を移動して見せる
110	    arrows: true,//左右の矢印あり
111	    prevArrow: '<div class="slick-prev"></div>',//矢印部分PreviewのHTMLを変更
112	    nextArrow: '<div class="slick-next"></div>',//矢印部分NextのHTMLを変更
113	    dots: true,//下部ドットナビゲーションの表示
114	        pauseOnFocus: false,//フォーカスで一時停止を無効
115	        pauseOnHover: false,//マウスホバーで一時停止を無効
116	        pauseOnDotsHover: false,//ドットナビゲーションをマウスホバーで一時停止を無効
117	});
118
119	//スマホ用:スライダーをタッチしても止めずにスライドをさせたい場合
120	$('.slider').on('touchmove', function(event, slick, currentSlide, nextSlide){
121	    $('.slider').slick('slickPlay');
122	});
123});

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.