PageSourceSearch

https://www.nishikofu.co.jp/wp_nkofu/wp-content/themes/nkofu_tm/js/common.js?1791427191

js nishikofu.co.jp collected 2026-10-08 02:40:04 UTC 20,110 bytes, 742 lines download raw bytes

1/****************************************************
2 *  contact form7 制御
3 ****************************************************/
4
5function wpcf7_on_confirm() {
6	var $wpcf7 = $('.wpcf7');
7	$wpcf7.addClass('is_confirm');
8	$('.wpcf7c-btn-back')[0].addEventListener('click', function() { $wpcf7.removeClass('is_confirm'); });
9	console.log("kauknin");
10}
11
12
13function wpcf7_noback() {
14	
15	location.hash="#noback";
16	onhashchange = function(){location.hash="#noback";};
17	
18	//window.addEventListener('popstate', hoge); 
19	 
20	history.pushState(null, null);
21	
22	window.addEventListener('popstate', (function(x) {	
23
24		return function f() {
25			alert('修正は戻るボタンを押して下さい。\nここではブラウザの戻るを禁止しています。');
26			window.removeEventListener('popstate', f, false);
27		}})
28			
29	(1), false);
30}
31
32
33
34/****************************************************
35 *  IE8以下アラート
36 ****************************************************/
37jQuery(function(){
38	jQuery("body").iealert();	
39});
40
41
42
43
44/****************************************************
45 *  ナビマウスオーバー
46 ****************************************************/
47jQuery(function(){
48	
49	//幅取得
50	var mainwidth = jQuery(window).width();
51
52	//ロード・リサイズで実行
53	jQuery(window).on('load resize', function(){
54		
55		mainwidth = jQuery(window).width();
56		
57		//PC
58		if(mainwidth > 768) {
59			
60			
61			
62			jQuery("header .menu ul li .child").css("display","none");	//全表示
63			//hover登録
64			jQuery('header .menu ul li').hover(function(){
65				jQuery("ul:not(:animated)", this).slideDown(200);
66			}, function(){
67				jQuery("ul.child",this).slideUp();
68			});
69			
70			
71			//Androidのタップの挙動制御
72			var num = 0;
73			if(userAgentAndroid()) {
74				jQuery('header .menu ul li a.parentLink').click(function(event){
75					
76									
77					//Androidタップしてもなにもしない
78					event.preventDefault();
79					
80					/* //Androidタブレットの場合2回タップしたらURL先へ移動
81					jQuery(this).data("click", ++num);
82					var click = jQuery(this).data("click");
83					if(click >= 2){
84						var url = jQuery(this).attr('href');		
85						window.location.href = url;
86					}
87					return false;
88					*/
89					
90				
91			  });
92			}
93				
94		}else {//スマホ
95			//jQuery("header .menu ul li .child").css("display","block");	//全表示
96			
97			jQuery("header .link h3").removeClass("active");
98			jQuery("header .child").css("display","none");	//全非表示
99
100			if($('header .toggle').length){
101				if(!jQuery._data(jQuery("header .toggle").get(0)).events) { //load resize 2回処理されるので…回避
102					jQuery("header .toggle").click(toggle);
103				}
104			}
105			
106			
107			//jQuery("header .menu ul li .child").css("display","none");	//全非表示
108			//jQuery('header .menu ul li').off('mouseenter mouseleave'); //hover削除
109		}
110		
111		//↓たぶんPCはスクロールバーの幅だけずれるから調整
112		if(!userAgent()){
113			if(mainwidth > 768 - 18) {
114				jQuery("header .menu ul li .child").css("display","none");	//全表示
115			}
116		}
117		
118		//トグル処理
119		function toggle() {
120			jQuery(this).toggleClass("active").next().stop().slideToggle(300);
121		}
122
123
124	});	
125	
126});
127
128/****************************************************
129 *  物件詳細スリック
130****************************************************/
131jQuery(function(){
132
133 	jQuery('.bukken_article .pictList ul').slick({
134		dots:false,
135		infinite: false,
136		arrows: false,
137		slidesToShow: 1,
138		//cssEase: 'ease-in',
139		easing: 'easeOutCubic',
140		autoplay: false,
141		autoplaySpeed: 5000,
142		speed: 800,
143		fade: false,
144		pauseOnHover: false,
145		centerMode: false,
146		centerPadding: '0',
147		adaptiveHeight: true,
148		asNavFor: '.bukken_article .thumb_item_nav ul',
149		draggable:true,
150		responsive: [
151				{
152				  breakpoint: 1100,
153				  settings: {
154					slidesToShow: 1,
155					centerMode: false,
156					centerPadding: '0',
157					draggable:true,
158				  }
159				},	
160				{
161				  //breakpoint: 769,
162				  breakpoint: 835,
163				  settings: {
164					slidesToShow: 1,
165					arrows: false,
166					centerMode: false,
167    				centerPadding: '0',
168					fade: false,
169					dots:true,
170					draggable:true,
171				  }
172				},		
173				{
174				  breakpoint: 640,
175				  settings: {
176					slidesToShow: 1,
177					arrows: false,
178					centerMode: false,
179    				centerPadding: '0',
180					fade: false,
181					dots:true,
182					draggable:true,
183				  }, 
184				},
185				{
186				  breakpoint: 320 + 1,
187				  settings: {
188					slidesToShow: 1,
189					arrows: false,
190					centerMode: false,
191    				centerPadding: '0',
192					fade: false,
193					dots:true,
194					draggable:true,
195				  }, 
196				}
197			  ]
198	});
199	
200	jQuery('.bukken_article .thumb_item_nav ul').slick({
201		accessibility: true,
202		autoplay: true,
203		autoplaySpeed: 4000,
204		speed: 400,
205		arrows: true,
206		infinite: true,
207		slidesToShow: 10,
208		slidesToScroll: 1,
209		asNavFor: '.bukken_article .pictList ul',
210		focusOnSelect: true,
211	});
212	
213	
214	
215
216	
217});
218
219
220
221
222/*******************************
223 *  ナビ固定
224*******************************/
225
226jQuery(function(){	
227	
228	//if(jQuery('header').length){ //ナビ要素あれば
229	var mainwidth;
230   	var box			= jQuery("header .md");
231	var boxTop		= box.offset().top;
232	mainwidth		= jQuery(window).width();
233	var bl			= false;
234	
235		if(!userAgent()) {
236
237			jQuery(window).on('load resize', function(){
238
239				mainwidth = jQuery(window).width();					
240				boxTop = box.offset().top;
241
242
243				if(mainwidth > 768) {	
244
245					jQuery(window).on('scroll', function(){
246
247						if(jQuery(window).scrollTop() >= boxTop +50) {
248
249							box.addClass("navFixed");
250
251						} else {
252
253							box.removeClass("navFixed");
254
255						}
256												
257						
258					});
259				}
260
261			});
262
263		}
264	
265	//}
266	
267	
268});
269
270
271/*******************************
272 *  検索ボックス表示
273 *******************************/
274jQuery(function() {
275    jQuery('.md .searchLi').click(function(){
276        jQuery('nav .formBox').slideToggle('fast');
277    });
278	
279	jQuery('.zenbu_title').click(function(){
280        jQuery('.zenbu').slideToggle('fast');
281    });
282	
283	jQuery(".search_layout .close").click(function() {
284		jQuery('nav .formBox').slideToggle('fast');
285	});
286	
287});
288
289
290/*******************************
291 *  ユーザーエージェント
292 *******************************/
293var $ua = navigator.userAgent;
294
295function userAgent() {
296	
297	if($ua.indexOf('iPhone') > 0 || $ua.indexOf('iPad') > 0 || $ua.indexOf('iPod') > 0 || $ua.indexOf('Android') > 0 || $ua.indexOf('BlackBerry') > 0 || $ua.indexOf('windows Phone') > 0 || $ua.indexOf('NOKIA') > 0 || /Mobile.*Firefox/.test($ua)){
298	 return true;
299	} else {
300	 return false;
301	}
302}
303
304function userAgentIos() {
305	if($ua.indexOf('iPhone') > 0 || $ua.indexOf('iPad') > 0 || $ua.indexOf('iPod') > 0 ){
306	 return true;
307	} else {
308	 return false;
309	}
310}
311
312function userAgentAndroid() {
313	
314	if($ua.indexOf('Android') > 0 || $ua.indexOf('BlackBerry') > 0 || $ua.indexOf('windows Phone') > 0 || $ua.indexOf('NOKIA') > 0 || /Mobile.*Firefox/.test($ua)){
315	 return true;
316	} else {
317	 return false;
318	}
319}
320
321/*******************************
322 *  スマホ モーダルメニュー
323 *******************************/
324$(function () {
325	var $body = $('body');
326	var state = false;
327	var scrollpos;
328	
329	$('#js_btn').on('click', function () {
330		$body.toggleClass('menu-open');
331		$('.menu-trigger').toggleClass('active');
332		
333		//bodyスクロールさせない
334		if(state == false) {
335			scrollpos = $(window).scrollTop();
336			$body.css({
337				'position': 'fixed',
338				'width': '100%',
339				'height': '100%',							
340				'top': -scrollpos
341			});
342			state = true;
343		} else {
344		 	$body.css({
345				'position': 'static',
346				'width': '',
347				'height': '',	
348				'top': 0
349			});
350		 	window.scrollTo( 0 , scrollpos );
351		  state = false;
352		}
353		
354	});
355	
356	
357});
358
359/****************************************************
360 *  検索クリック
361 ****************************************************/
362jQuery(function(){
363	
364	jQuery("#searchTitle").click(function() {
365		jQuery(".searchLayout .inner").stop().slideToggle(200);
366		jQuery("#searchTitle").toggleClass("active");//追加部分
367	});
368	
369	var mainwidth		= jQuery(window).width();
370	if(mainwidth < 768) {
371		//jQuery(".searchLayout .inner").css("display","none");
372	}
373	
374	/*
375	if(jQuery("#searchTitle").hasClass("active")){
376       jQuery(".searchLayout .inner").css("display","none");
377    }
378	*/
379			
380});
381
382
383
384/*******************************
385 *  よくある質問
386 *******************************/
387 /*
388jQuery(function() {
389	
390	   // ---- FAQs ---------------------------------------------------------------------------------------------------------------
391		
392		$('.faqs dd').hide(); // Hide all DDs inside .faqs
393		$('.faqs dt').hover(function(){$(this).addClass('hover')},function(){$(this).removeClass('hover')}).click(function(){ // Add class "hover" on dt when hover
394		$(this).next().slideToggle('normal'); // Toggle dd when the respective dt is clicked
395		}); 
396	
397});
398*/
399
400jQuery(function() {
401	
402	   // ---- FAQs ---------------------------------------------------------------------------------------------------------------
403		
404		$('.faqs .aBox').hide(); // Hide all DDs inside .faqs
405		$('.faqs .qBox').hover(function(){$(this).addClass('hover')},function(){$(this).removeClass('hover')}).click(function(){ // Add class "hover" on dt when hover
406		$(this).next().slideToggle('normal'); // Toggle dd when the respective dt is clicked
407		$(this).toggleClass("active");
408		}); 
409	
410});
411
412
413/*******************************
414 *  画像オンマウス薄く
415 *******************************/
416jQuery(function() {
417	  //画像リンク	  
418	  jQuery('a img').hover(
419        function(){
420          jQuery(this).stop().animate({'opacity' : '1'}, 100);  
421        },
422        function () {
423          jQuery(this).stop().animate({'opacity' : '1'}, 0);
424        }
425    );
426});
427
428
429/*******************************
430 * ページトップへ
431 *******************************/
432
433jQuery(function() {
434	var topBtn = jQuery('#pt a');
435	
436	
437	topBtn.hide();
438	//スクロールが100に達したらボタン表示
439	jQuery(window).scroll(function () {
440		if (jQuery(this).scrollTop() > 100) {
441			topBtn.fadeIn();
442		} else {
443			topBtn.fadeOut();
444		}
445	});
446	
447	
448    topBtn.click(function () {		
449		jQuery('body,html').animate({
450			scrollTop: 0
451		}, 500);
452		return false;
453    });
454});
455
456
457/*******************************
458 * アンカースクロール
459 *******************************/
460jQuery(function() {
461   //jQuery('a[href^=#]:not(a[href=#])').click(function() {
462	jQuery('a[href^=\\#]:not(a[href=\\#])').click(function() {
463	  var mainwidth		= jQuery(window).width();
464      var speed = 400; // ミリ秒
465      var href= jQuery(this).attr("href");
466      var target = jQuery(href == "#" || href == "" ? 'html' : href);
467      var position = target.offset().top;
468      //jQuery('body,html').animate({scrollTop:position}, speed, 'swing');
469	  
470	  //スマホの場合位置調整
471	  if(mainwidth < 768) {
472		  position 	-= 40; //スマホヘッダー固定 位置調整
473	  }else {
474		  position -= 70; //ナビ固定 位置調整
475	  }
476	  
477	  jQuery('body,html').animate({scrollTop:position}, speed, 'swing');
478		  
479	  
480      return false;
481   });
482});
483
484
485
486
487
488/*******************************
489*スマホ hover
490*******************************/
491
492jQuery(function(){
493  var tapClass = "";
494  var hoverClass = "";
495
496	var Hover = window.Hover = function (ele) {
497		return new Hover.fn.init(ele);
498	};
499	Hover.fn = {
500		//Hover Instance
501		 init : function (ele) {
502			this.prop = ele;
503		}
504
505		, bind : function (_hoverClass, _tapClass) {
506			hoverClass = _hoverClass;
507			tapClass = _tapClass;
508
509			$(window).bind("touchstart", function(event) {
510				var target = event.target || window.target;
511
512				var bindElement = null;
513				if (target.tagName == "A" || $(target).hasClass(tapClass)) {
514					bindElement = $(target);
515				} else if ($(target).parents("a").length > 0) {
516					bindElement = $(target).parents("a");
517				} else if ($(target).parents("." + tapClass).length > 0) {
518					bindElement = $(target).parents("." + tapClass);
519				}
520
521				if (bindElement != null) {
522					Hover().touchstartHoverElement(bindElement);
523				}
524			});
525		}
526		, touchstartHoverElement : function (bindElement) {
527			bindElement.addClass(hoverClass);
528			bindElement.unbind("touchmove", Hover().touchmoveHoverElement);
529			bindElement.bind("touchmove", Hover().touchmoveHoverElement);
530
531			bindElement.unbind("touchend", Hover().touchendHoverElement);
532			bindElement.bind("touchend", Hover().touchendHoverElement);
533		}
534		, touchmoveHoverElement : function (event) {
535			$(this).removeClass(hoverClass);
536		}
537		, touchendHoverElement : function (event) {
538			$(this).removeClass(hoverClass);
539		}
540	}
541	Hover.fn.init.prototype = Hover.fn;
542
543	Hover().bind("hover", "tap");
544});
545
546
547
548
549
550
551
552
553
554
555/*******************************
556 *  スマホ フッターナビ 高さ調整スマホなし
557 *******************************/
558
559jQuery(function(){	
560
561	//幅取得
562	var mainwidth = jQuery(window).width();
563	
564	//PCの場合高さ調整
565	//jQuery("#footer_nav>ul>li").heightLine({ minWidth:768 - 18});
566
567	//ロード・リサイズで実行
568	jQuery(window).on('load resize', function(){
569		
570		mainwidth = jQuery(window).width();
571		
572		//PC
573		if(mainwidth > 768) {
574			jQuery("#footer .toggle").unbind('click');
575			jQuery("#footer .child").css("display","block");//全表示
576			
577		}else {//スマホ
578			jQuery("#footer .link h3").removeClass("active");
579			jQuery("#footer .child").css("display","none");	//全非表示
580			
581			if($('#footer .toggle').length){
582				if(!jQuery._data(jQuery("#footer .toggle").get(0)).events) { //load resize 2回処理されるので…回避
583					jQuery("#footer .toggle").click(toggle);
584				}
585			}
586		}
587
588	});
589	
590	
591	//トグル処理
592	function toggle() {
593		jQuery(this).toggleClass("active").next().stop().slideToggle(300);
594	}
595	
596});
597
598
599
600
601
602/*******************************
603 *20210810 フッターメニュー
604 *******************************/
605
606jQuery(function() {
607	var fixFooterBtn = jQuery('.fixFooterBtn');
608	
609	
610	fixFooterBtn.hide();
611	//スクロールが100に達したらボタン表示
612	jQuery(window).scroll(function () {
613		if (jQuery(this).scrollTop() > 100) {
614			fixFooterBtn.fadeIn();
615		} else {
616			fixFooterBtn.fadeOut();
617		}
618	});
619
620});
621
622
623
624
625
626/*******************************
627 *20241017 スクロールテーブル
628 *******************************/
629 document.addEventListener('DOMContentLoaded', function() {
630	// tableのレスポンシブ対応
631	// ブレイクポイント時
632	const mediaQuery = window.matchMedia('(max-width:834px)');
633	handle(mediaQuery);
634	mediaQuery.addListener(handle);
635	function handle(mm) {
636		const elemTable = document.getElementsByClassName('scroll-table');
637		const tableLength = elemTable.length;
638		// スマホ幅の場合1
639		if (mm.matches) {
640			for (let i = 0; i < tableLength; i++) {
641				// 取得したクラスリストに該当のクラスが存在しないか
642				// if (!elemTable[i].classList.contains('not-scroll-table')) {
643					// スクロールテーブルを適用するか判定
644					const cloneTable = elemTable[i].cloneNode(true);
645					cloneTable.style.cssText += 'width:auto';
646					function convertScrollTable() {
647						// スマホ幅の場合2
648						if (mm.matches) {
649							// 本物の表のafterにダミーの表を挿入
650							elemTable[i].parentNode.insertBefore(cloneTable, elemTable[i].nextElementSibling); // IE未対応(古いEdgeも)なら.after(cloneTable)も可能
651							cloneTable.outerHTML = '<div class="js-dummy-table" style="visibility:hidden;">' + cloneTable.outerHTML + '</div>';
652							// ダミー表の可視範囲を取得
653							const elemDummyTable = elemTable[i].nextElementSibling;
654							const tableVisibleRange = Math.ceil(elemDummyTable.getBoundingClientRect().width); // 小数点切り上げ padding/borderは無いこと限定
655							// ダミー表の折り返し無しでの表幅を取得
656							elemDummyTable.style.cssText += 'width:1920px;'; // 1920pxは任意
657							const noWrapTableWidth = Math.ceil(elemDummyTable.children[0].getBoundingClientRect().width); // 折り返し無しでのtable幅 // 小数点切り上げ
658							elemDummyTable.remove(); // ここで条件確認のためのダミー要素を削除(削除しないと動的に生成したダミー要素がtableとして認識されてしまう)
659							// スクロールテーブルに変換する条件(可視範囲より折り返し無し表幅が大きい場合)に合致している場合
660							if (tableVisibleRange < noWrapTableWidth) {
661								// スクロールテーブルに変換済みか判定
662								if (!elemTable[i].parentNode.classList.contains('js-scroll-table')) {
663									const valueTableMarginTop = parseInt(window.getComputedStyle(elemTable[i]).getPropertyValue('margin-top')); // div.js-scroll-tableで囲まれる前に取得
664									elemTable[i].outerHTML = '<div class="js-scroll-table-wrap"><div class="js-scroll-table-frame"><div class="js-scroll-table">' + elemTable[i].outerHTML + '</div></div></div>';
665									elemTable[i].parentNode.parentNode.parentNode.style.marginTop = valueTableMarginTop + 'px'; // IE未対応(古いEdgeも)なら.closest('.js-scroll-table-wrap')も可能
666									elemTable[i].style.marginTop = '0';
667								}
668								// スクロールテーブルの可視範囲(最大幅)の設定があるか判定
669								// if (parseInt(window.getComputedStyle(elemTable[i]).getPropertyValue('max-width'))) {
670									// スクロールテーブルの可視範囲(最大幅)と折り返し無し表幅と比較してmin-widthを設定
671									// if (parseInt(window.getComputedStyle(elemTable[i]).getPropertyValue('max-width')) < noWrapTableWidth) {
672										// elemTable[i].style.minWidth = parseInt(window.getComputedStyle(elemTable[i]).getPropertyValue('max-width')) + 'px';
673									// }
674									// else {
675										elemTable[i].style.minWidth = noWrapTableWidth + 'px';
676									// }
677								// }
678							}
679							//
680							const valueTableActualWidth = Math.ceil(elemTable[i].getBoundingClientRect().width); // 小数点のまま
681							const elemScrollTableFrame = elemTable[i].parentNode.parentNode; // IE未対応(古いEdgeも)なら.closest('.js-scroll-table-frame')も可能
682							const elemScrollTableWrap = elemTable[i].parentNode.parentNode.parentNode;
683							function scrollTable() {
684								const valueTableScrollLeft = elemTable[i].parentNode.scrollLeft; // 小数点もあり得る(Windowsブラウザ)
685								const valueScrollTableWidth = elemTable[i].parentNode.clientWidth + 0.5; // 四捨五入で0.5未満の場合に不足になるため0.5を追加
686								if (Math.ceil(valueTableScrollLeft + valueScrollTableWidth) < valueTableActualWidth) {
687									elemScrollTableFrame.classList.add('overflow-after');
688								}
689								else {
690									elemScrollTableFrame.classList.remove('overflow-after');
691								}
692								if (valueTableScrollLeft > 0) {
693									elemScrollTableFrame.classList.add('overflow-before');
694								}
695								else {
696									elemScrollTableFrame.classList.remove('overflow-before');
697								}
698								if (Math.ceil(valueScrollTableWidth) < valueTableActualWidth) {
699									elemScrollTableWrap.classList.add('notes');
700								}
701								else {
702									elemScrollTableWrap.classList.remove('notes');
703								}
704							}
705							// ロード時
706							scrollTable();
707							// 要素スクロール時
708							elemTable[i].parentElement.addEventListener('scroll', function() {
709								scrollTable();
710							});
711						}
712						// PC幅の場合convertScrollTable関数を無効化するため
713						else {
714							return;
715						}
716					}
717					//
718					// ロード時
719					convertScrollTable();
720					// windowリサイズ時(リサイズ終了後に処理)スマホアドレスバー対応済み
721					let tx = false;
722					let windowWidth = window.innerWidth;
723					let windowResizeWidth;
724					window.addEventListener('resize', function() {
725						if (tx !== false) clearTimeout(tx);
726						tx = setTimeout(function() {
727							windowResizeWidth = window.innerWidth;
728							if(windowWidth !== windowResizeWidth) {
729								convertScrollTable();
730							}
731						}, 250);
732					});
733				// }
734			}
735		}
736		else {
737			for (let i = 0; i < tableLength; i++) {
738				elemTable[i].style.minWidth = '';
739			}
740		}
741	}
742 });

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.