PageSourceSearch

https://www.kasuke.co.jp/Sf3Mc6ez/wp-content/themes/reform/js/main.js?ver=1.1.0

js kasuke.co.jp collected 2026-09-30 19:54:01 UTC 6,919 bytes, 226 lines download raw bytes

1
2/*  picturefill.js
3-------------------------------------------------------*/
4document.createElement( "picture" );
5
6
7/*  ofi.js
8-------------------------------------------------------*/
9objectFitImages('.obfit-inter, .obfit-blog , .obfit-blog-a , .obfit-event , obfit-event-a , .obfit-event1 ,.obfit-seko , .obfit-seko1 , .obfit-seko-gallery , .obfit-voice , .obfit-voice-a , .obfit-reformmenu , .obfit-reformmenu-a');
10
11
12/*  スマホアコーディオンメニュー
13-------------------------------------------------------*/
14
15$(function(){
16	if (window.matchMedia('screen and (max-width:768px)').matches) {
17	$('.navi > li p').click(function(){
18		$(this).next('.submenu').slideToggle();
19		$(this).toggleClass('is-open');
20		$('.navi > li p').not($(this)).next('.submenu').slideUp();
21	});
22	}
23  $('.submenu > li span').click(function(){
24		$(this).next('.submenu-seko').slideToggle();
25		$(this).toggleClass('is-open');
26		$('.submenu > li span').not($(this)).next('.submenu-seko').slideUp();
27	});
28});
29
30
31/*  トグルメニュー
32-------------------------------------------------------*/
33$(function(){
34  $('#toggle').click(function() {
35    $('.navi-container,.header-txt').toggleClass('open');
36  });
37  $('#close-btn').click( function () {
38    $('.navi-container,.header-txt').removeClass('open');
39  });
40});
41
42
43/* フローティング(フッター前固定)
44------------------------------------- */
45
46$(function() {
47  $(window).scroll(function() {
48		if (window.matchMedia( '(min-width: 1024px)' ).matches) {
49    var floating = $(".floating");
50    var scroll = $(window).scrollTop() + $(window).height();
51    var footer = $("footer").offset().top;
52    var absoluteBottom = $("footer").outerHeight();
53    if ($(window).scrollTop() > $(window).height()) {
54      floating.fadeIn();
55    } else {
56      floating.fadeOut();
57    }
58    if (scroll > footer) {
59      floating.css({
60        "position": "relative",
61      });
62    } else {
63      floating.css({
64        "position": "fixed",
65        "bottom": "0",
66      });
67    }
68	} else {
69		var floating = $(".floating-sp");
70    var scroll = $(window).scrollTop() + $(window).height();
71    var footer = $("footer").offset().top;
72    var absoluteBottom = $("footer").outerHeight();
73    if ($(window).scrollTop() > $(window).height()) {
74      floating.fadeIn();
75    } else {
76      floating.fadeOut();
77    }
78    if (scroll > footer) {
79      floating.css({
80        "position": "relative",
81      });
82    } else {
83      floating.css({
84        "position": "fixed",
85        "bottom": "0",
86      });
87    }
88	}
89  });
90});
91
92
93/* スムーススクロール
94------------------------------------- */
95$(function() {
96  $('a[href^="#"]').click(function() {
97    var href= $(this).attr('href');
98    var target = $(href == '#' || href == '' ? 'html' : href);
99    var position = target.offset().top;
100    $('html,body').animate({scrollTop: position}, 700, 'swing');
101    return false;
102  });
103});
104
105
106// お問合せ、入力エラー箇所へ移動
107$(function(){
108  // Contact Form 7
109  var wpcf7El = document.querySelector(".wpcf7")
110
111  // エラーが発生した時
112  wpcf7El.addEventListener("wpcf7invalid", function() {
113    var speed = 1000; // スクロール速度
114    var headerHeight = 50; // ヘッダーの高さを取得
115    setTimeout(function () {
116      var firstErrorEl = $(".wpcf7-not-valid:first"); // エラーが発生した1番目の要素を取得
117      var scrollAmount = firstErrorEl.offset().top - headerHeight; // 要素までのスクロール距離を取得
118      $("html, body").animate({ scrollTop: scrollAmount }, speed, "swing"); // 該当箇所までスクロール
119    }, 500);
120  },false );
121});
122
123$(function() {
124  $('#sale-post_s .acv-flex-wrap h3, .acv-flex-wrap h4').matchHeight();
125});
126
127
128/*  施工事例 - スマホアコーディオンメニュー
129-------------------------------------------------------*/
130if (window.matchMedia('screen and (max-width:480px)').matches) {
131  $('.accodion-head').on('click', function() {
132    var findElm = $(this).next(".accodion-area");
133    $(findElm).slideToggle();
134    if($(this).hasClass('close')){
135      $(this).removeClass('close');
136    }else{
137      $(this).addClass('close');
138    }
139  });
140}
141
142/*  コンテスト受賞実績 - アコーディオンメニュー
143-------------------------------------------------------*/
144$('.awards-accodion-head').on('click', function() {
145  var findElm = $(this).next(".awards-accodion-area");
146  $(findElm).slideToggle();
147  if($(this).hasClass('close')){
148    $(this).removeClass('close');
149  }else{
150    $(this).addClass('close');
151  }
152});
153
154/*  gnavi アコーディオンメニュー
155-------------------------------------------------------*/
156$(function(){
157  $('.gnavi-submenu > li span').click(function(){
158		$(this).next('.gnavi-submenu-seko').slideToggle();
159		$(this).toggleClass('is-open');
160		$('.gnavi-submenu >
160 li span').not($(this)).next('.gnavi-submenu-seko').slideUp();
161	});
162});
163
164
165/* gnavi フローティング
166------------------------------------- */
167$(function() {
168  var startPos = 0,
169  winScrollTop = 0;
170  var gnavi = $(".gnavi");
171  var fixedClass = 'is-fixed';
172  var headerHeight = $("header").outerHeight(); //ヘッダーの高さを取得
173  var mvHeight = $(".mainvisual").length ? $(".mainvisual").outerHeight() : 0; // .mainvisualがある場合の高さを取得
174  var hmHeight = headerHeight + mvHeight;
175  $(window).on('scroll',function(){
176    if (window.matchMedia( '(min-width: 1024px)' ).matches) {
177      winScrollTop = $(this).scrollTop();
178      if (winScrollTop <= hmHeight) { 
179        gnavi.removeClass(fixedClass);
180      } else if (winScrollTop > startPos) {
181        gnavi.removeClass(fixedClass);
182      } else {
183        gnavi.addClass(fixedClass);
184      }
185      startPos = winScrollTop;
186    }
187  });
188});
189
190
191/* フローティング(イベント)
192------------------------------------- */
193$(function() {
194  $(window).scroll(function() {
195    var floating = $(".floating-event:not(.floating-showroom)");
196    var footer = $("#event-form-posi").offset().top;
197    var windowHeight = $(window).height();
198    var objTop = $('#event-summary').offset().top;
199    if ($(window).scrollTop() > objTop - windowHeight && $(window).scrollTop() < footer - windowHeight) {
200      floating.fadeIn();
201      floating.css({
202        "position": "fixed",
203        "bottom": "0",
204      });
205    } else {
206      floating.fadeOut();
207    }
208  });
209});
210
211/* カタカナ項目送信ボタン下のエラーメッセージ変更
212------------------------------------- */
213const targetElement = document.querySelector('#your-name-kana');
214const observer = new MutationObserver((mutations) => {
215  mutations.forEach((mutation) => {
216    if (mutation.attributeName === 'class') {
217      var error = $('#your-name-kana').hasClass('wpcf7-not-valid');
218  if(error) {
219    $('.wpcf7-response-output').html('カタカナで入力してください。');
220  }
221    }
222  });
223});
224const config = { attributes: true };
225observer.observe(targetElement, config);
226

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.