PageSourceSearch

https://sekidoclinic.com/wp-content/themes/genova_tpl/js/share.js

js sekidoclinic.com collected 2026-10-05 11:06:29 UTC 28,097 bytes, 879 lines download raw bytes

1/* =====================================
2	header_scroll_toggle
3===================================== */
4$(document).ready(function () {
5	var defPos = 0;
6	$(window).scroll(function () {
7		var currentPos = $(this).scrollTop();
8		if (currentPos > defPos) {
9			if ($(window).scrollTop() >= 150) {
10				var hh = $("#header").height();
11				$("#header").css("top", "-" + hh + "px");
12			}
13		} else {
14			$("#header").css("top", 0 + "px");
15		}
16		defPos = currentPos;
17	});
18});
19
20/* =====================================
21	Header Structure EX
22===================================== */
23jQuery(document).ready(function () {
24	checkUA();
25	checkBrowzer();
26
27	var ww = document.body.clientWidth;
28	$(".toggleMenu").click(function (e) {
29		e.preventDefault();
30		$(this).toggleClass("active");
31		$(".g_nav").fadeToggle();
32	});
33
34	$(".g_nav>li>span").each(function () {
35		$(this).addClass("parent");
36	})
37	adjustMenu(ww);
38});
39
40function adjustMenu(ww) {
41	if (ww <= 767) { //767以下=スマホ
42		$(".toggleMenu img").css("display", "inline-block");
43		if (!$(".toggleMenu").hasClass("active")) {
44			$(".g_nav").hide();
45		} else {
46			$(".g_nav").css("display", "block");
47		}
48		$(".g_nav>li").unbind('mouseenter mouseleave');
49		$(".g_nav li span.parent").unbind("click");
50		$(".g_nav li span.parent").click(function (e) {
51			e.preventDefault();
52			$(this).parent("li").toggleClass('hover');
53		});
54
55	} else { //768以上=PC,タブレット
56		$(".toggleMenu img").css("display", "none");
57		$(".g_nav").removeAttr("style");
58
59		if(ua_type == 'TB'){
60			$(".g_nav>li").unbind('mouseenter mouseleave');
61			$(".g_nav li span.parent").unbind("click");
62			$(".g_nav li span.parent").click(function (e) {
63				e.preventDefault();
64				//e.stopPropagation();
65				if($(this).next('dl').is(':visible')) {
66					$(this).next('dl').hide();
67					$(this).parent("li").toggleClass('hover');
68				} else {
69					$('#header .g_nav > li > dl').hide();
70					$('#header .header_menu .g_nav').find('li').removeClass('hover');
71					$(this).next('dl').show();
72					$(this).parent("li").addClass('hover');
73				}
74			});
75		}else {
76			$(".g_nav>li").unbind("hover");
77			$(".g_nav>li").hover(function () {
78				$(this).addClass('hover');
79			}, function () {
80				$(this).removeClass('hover');
81			});
82		}
83	}
84}
85$(window).bind('resize orientationchange', function () {
86	//ww = document.body.clientWidth;
87	ww = window.innerWidth;
88	adjustMenu(ww);
89});
90
91function checkUA() {
92	ua = window.navigator.userAgent;
93	if( (ua.indexOf('Android') > 0 && ua.indexOf('Mobile') > 0) || ua.indexOf('iPod') > 0 || (ua.indexOf('iPhone') > 0 && ua.indexOf('iPad') == -1)) {
94		ua_type = 'SP';
95		if(ua.indexOf('Android') > 0 && ua.indexOf('Mobile') > 0){
96			var win_w = $(window).width();
97			if(win_w >= 768){
98				ua_type = 'TB';
99			}
100		}
101	} else if(ua.indexOf('Android') > 0 || ua.indexOf('iPad') > 0){
102		ua_type = 'TB';
103		if(ua.indexOf('Android') > 0){
104			var win_w = $(window).width();
105			if(win_w <= 767){
106				ua_type = 'SP';
107			}
108		}
109	} else {
110		ua_type = 'PC';
111	}
112
113	if(ua_type == 'TB'){
114		$('body').addClass('tablet');
115	}else{
116		$('body').removeClass('tablet');
117	}
118
119	if(ua_type == 'PC'){
120		$('body').addClass('desktop');
121	}else{
122		$('body').removeClass('desktop');
123	}
124}
125
126function checkBrowzer() {
127	if(ua.indexOf('WebKit') > 0){
128		isWebkit = true;
129	}
130	if(ua.indexOf('Firefox') > 0){
131		isFF = true;
132	}
133	if(ua.indexOf('MSIE') > 0){
134		isIE = true;
135	}
136}
137
138function isTabs(){
139	var userAgent = window.navigator.userAgent.toLowerCase();
140	if((navigator.userAgent.indexOf('Android') > 0 && navigator.userAgent.indexOf('Mobile') == -1) || navigator.userAgent.indexOf('A1_07') > 0 || navigator.userAgent.indexOf('SC-01C') > 0 || navigator.userAgent.indexOf('iPad') > 0){
141		return true;
142	}else{
143		return false;
144	}
145}
146
147/* -------------------------------------
148iPhoneで画面を戻った際にメニューが残る現象を回避
149------------------------------------- */
150$("#header .g_nav li a").click(function(){
151	if($(window).width() < 768) {
152		$(".toggleMenu").removeClass("active");
153		$("#header .g_nav").fadeOut("500"); 
154	}
155}); 
156
157/* -------------------------------------
158プルダウンにカーソルを置いているとリンクをクリックした後も消えない現象を回避
159------------------------------------- */
160$("#header .g_nav > li dl a").click(function () {
161	$("#header .g_nav > li").removeClass("hover");
162	$(".tablet #header .g_nav > li > dl").hide();
163});
164$("#header .g_nav > li > a, #header .g_nav > li > span").hover(function () {
165	$(".desktop #header .g_nav > li > dl").css("display", "block");
166});
167
168
169
170$(function() {
171	if($(window).width()>767) {
172		$( '.tablet #header .g_nav > li:has(dl)' ).doubleTapToGo();
173	}
174});
175
176/*
177	By Osvaldas Valutis, www.osvaldas.info
178	Available for use under the MIT License
179*/
180;(function( $, window, document, undefined )
181{
182	$.fn.doubleTapToGo = function( params )
183	{
184		if( !( 'ontouchstart' in window ) &&
185			!navigator.msMaxTouchPoints &&
186			!navigator.userAgent.toLowerCase().match( /windows phone os 7/i ) ) return false;
187
188		this.each( function()
189		{
190			var curItem = false;
191
192			$( this ).on( 'click', function( e )
193			{
194				var item = $( this );
195				if( item[ 0 ] != curItem[ 0 ] )
196				{
197					e.preventDefault();
198					curItem = item;
199				}
200			});
201
202			$( document ).on( 'click touchstart MSPointerDown', function( e )
203			{
204				var resetItem = true,
205					parents	  = $( e.target ).parents();
206
207				for( var i = 0; i < parents.length; i++ )
208					if( parents[ i ] == curItem[ 0 ] )
209						resetItem = false;
210
211				if( resetItem )
212					curItem = false;
213			});
214		});
215		return this;
216	};
217})( jQuery, window, document );
218
219
220
221/* =====================================
222				Footer
223===================================== */
224$(function () {
225	var defPos = 0;
226	$(window).scroll(function () {
227		var currentPos = $(this).scrollTop();
228		if (currentPos > defPos) {
229			if ($(window).scrollTop() >= 300) {
230				$(".fixed_box").css("bottom", 0 + "px");
231			}
232		} else {
233			$(".fixed_box").css("bottom", -150 + "px");
234		}
235		defPos = currentPos;
236	});
237});
238
239
240/* =====================================
241				matchHeight
242===================================== */
243jQuery(function(){
244	$('.js-matchHeight').matchHeight();
245});
246
247
248
249/* =====================================
250	全ての読み込み完了後に呼ばれる関数
251===================================== */
252jQuery.event.add(window,"load",function() {
253	
254	/* -------------------------------------
255			アンカーリンククリック
256	------------------------------------- */
257	jQuery(function(){
258		//アンカーリンククリック
259		$('a[href^=#]').click(function(){
260			setTimeout(gnavHide, "500");
261		});
262
263		//ロード時にアンカーリンクの場合、ヘッダー非表示
264		var hash = location.hash;
265		if(hash!="") {
266			setTimeout(gnavHide, "500");
267		}
268		function gnavHide() {
269			var hh = $("#header").height();
270			$("#header").css("top", "-" + hh + "px");
271		}
272	});
273
274	//他ページからのアンカーリンク(150の箇所はヘッダー+サブメニューの高さに設定)
275	$(window).load(function () {
276		var headerHight = $("#header").height();
277		var $path = location.href;
278		var $index = $path.indexOf("#");
279		var $sub = $path.substring($index);
280		if($index != -1) {
281			var target = $($sub);
282			var offsetTop = target.offset().top;
283			$('html,body').animate({
284				scrollTop: offsetTop
285			}, 500);
286		}
287	});
288	
289
290	/* -------------------------------------
291					bxSlider
292	------------------------------------- 
293	$(".home #mainimage").css("display", "block");
294
295	$(document).ready(function(){
296		$('.bxslider').bxSlider({ 
297			mode: 'fade',
298			auto: true,
299			speed: 5000,
300			pause: 2000,
301			touchEnabled: false,
302			controls: false,
303			pager: false, 
304			preventDefaultSwipeY: true
305		});
306	});
307	*/
308	
309	
310	/* -------------------------------------
311		 自動スライド画像
312	------------------------------------- */
313	$(function(){
314		$('#loopslider').each(function(){
315			var loopsliderWidth = $(this).width();
316			var loopsliderHeight = $(this).height();
317			$(this).children('ul').wrapAll('<div id="loopslider_wrap"></div>');
318			var listWidth = $('#loopslider_wrap').children('ul').children('li').width();
319			var listCount = $('#loopslider_wrap').children('ul').children('li').length;
320			var loopWidth = (listWidth)*(listCount);
321			$('#loopslider_wrap').css({
322				top: '0',
323				left: '0',
324				width: ((loopWidth) * 3),
325				height: (loopsliderHeight),
326				overflow: 'hidden',
327				position: 'absolute'
328			});
329			$('#loopslider_wrap ul').css({
330				width: (loopWidth)
331			});
332			loopsliderPosition();
333			function loopsliderPosition(){
334				$('#loopslider_wrap').css({left:'0'});
335				$('#loopslider_wrap').stop().animate({left:'-' + (loopWidth) + 'px'},55000,'linear');
336				setTimeout(function(){
337					loopsliderPosition();
338				},55000);
339			};
340			$('#loopslider_wrap ul').clone().appendTo('#loopslider_wrap');
341			$('#loopslider_wrap ul').clone().prependTo('#loopslider_wrap');
342		});
343	});
344
345	
346	/* -------------------------------------
347		menu img
348	------------------------------------- */
349	$(document).ready(function(){
350		var menuliIndex=-1;
351		var menuliHeight=$(".menuWrap").height();
352		if($(window).width()>=768) {
353			$(".menu_section .txtWrap > ul > li").height(menuliHeight);
354			if ( $(".menuWrap li").length > 0 ) {
355				$(".menuWrap li").each(function () {
356					$(this).mouseover(function(){  
357						menuliIndex=$(this).index();           
358						$(".menu_section .txtWrap > ul > li").eq(menuliIndex).css("opacity", 1);
359					}).mouseout(function(){
360						$(".menu_section .txtWrap > ul > li").eq(menuliIndex).css("opacity", 0);
361					});
362				});
363			}
364		}
365	});
366	$(window).bind('resize orientationchange', function () {
367		var menuliHeight=$(".menuWrap").height();
368		$(".menu_section .txtWrap > ul > li").height(menuliHeight);
369	});
370});
371
372
373/*--------------------------------------------------------------------------*
374 *  
375 *  heightLine JavaScript Library beta4
376 *  
377 *  MIT-style license. 
378 *  
379 *  2007 Kazuma Nishihata 
380 *  http://www.webcreativepark.net
381 *  
382 *--------------------------------------------------------------------------*/
383new function(){
384
385	function heightLine(){
386
387
388		this.className="heightLine";
389		this.parentClassName="heightLineParent";
390		reg = new RegExp(this.className+"-([a-zA-Z0-9-_]+)", "i");
391		objCN =new Array();
392		var objAll = document.getElementsByTagName ? document.getElementsByTagName("*") : document.all;
393		for(var i = 0; i < objAll.length; i++) {
394			var eltClass = objAll[i].className.split(/\s+/);
395			for(var j = 0; j < eltClass.length; j++) {
396				if(eltClass[j] == this.className) {
397					if(!objCN["main CN"]) objCN["main CN"] = new Array();
398					objCN["main CN"].push(objAll[i]);
399					break;
400				}else if(eltClass[j] == this.parentClassName){
401					if(!objCN["parent CN"]) objCN["parent CN"] = new Array();
402					objCN["parent CN"].push(objAll[i]);
403					break;
404				}else if(eltClass[j].match(reg)){
405					var OCN = eltClass[j].match(reg)
406					if(!objCN[OCN]) objCN[OCN]=new Array();
407					objCN[OCN].push(objAll[i]);
408					break;
409				}
410			}
411		}
412
413		//check font size
414		var e = document.createElement("div");
415		var s = document.createTextNode("S");
416		e.appendChild(s);
417		e.style.visibility="hidden"
418		e.style.position="absolute"
419		e.style.top="0"
420		document.body.appendChild(e);
421		var defHeight = e.offsetHeight;
422
423		changeBoxSize = function(){
424			for(var key in objCN){
425				if (objCN.hasOwnProperty(key)) {
426					//parent type
427					if(key == "parent CN"){
428						for(var i=0 ; i<objCN[key].length ; i++){
429							var max_height=0;
430							var CCN = objCN[key][i].childNodes;
431							for(var j=0 ; j<CCN.length ; j++){
432								if(CCN[j] && CCN[j].nodeType == 1){
433									CCN[j].style.height="auto";
434									max_height = max_height>CCN[j].offsetHeight?max_height:CCN[j].offsetHeight;
435								}
436							}
437							for(var j=0 ; j<CCN.length ; j++){
438								if(CCN[j].style){
439									var stylea = CCN[j].currentStyle || document.defaultView.getComputedStyle(CCN[j], '');
440									var newheight = max_height;
441									if(stylea.paddingTop)newheight -= stylea.paddingTop.replace("px","");
442									if(stylea.paddingBottom)newheight -= stylea.paddingBottom.replace("px","");
443									if(stylea.borderTopWidth && stylea.borderTopWidth != "medium")newheight-= stylea.borderTopWidth.replace("px","");
444									if(stylea.borderBottomWidth && stylea.borderBottomWidth != "medium")newheight-= stylea.borderBottomWidth.replace("px","");
445									CCN[j].style.height =newheight+"px";
446								}
447							}
448						}
449					}else{
450						var max_height=0;
451						for(var i=0 ; i<objCN[key].length ; i++){
452							objCN[key][i].style.height="auto";
453							max_height = max_height>objCN[key][i].offsetHeight?max_height:objCN[key][i].offsetHeight;
454						}
455						for(var i=0 ; i<objCN[key].length ; i++){
456							if(objCN[key][i].style){
457								var stylea = objCN[key][i].currentStyle || document.defaultView.getComputedStyle(objCN[key][i], '');
458								var newheight = max_height;
459								if(stylea.paddingTop)newheight-= stylea.paddingTop.replace("px","");
460								if(stylea.paddingBottom)newheight-= stylea.paddingBottom.replace("px","");
461								if(stylea.borderTopWidth && stylea.borderTopWidth != "medium")newheight-= stylea.borderTopWidth.replace("px","")
462								if(stylea.borderBottomWidth && stylea.borderBottomWidth != "medium")newheight-= stylea.borderBottomWidth.replace("px","");
463								objCN[key][i].style.height =newheight+"px";
464							}
465						}
466					}
467				}
468			}
469		}
470
471		checkBoxSize = function(){
472			if(defHeight != e.offsetHeight){
473				changeBoxSize();
474				defHeight= e.offsetHeight;
475			}
476		}
477		changeBoxSize();
478		setInterval(checkBoxSize,1000)
479		window.onresize=changeBoxSize;
480	}
481
482	function addEvent(elm,listener,fn){
483		try{
484			elm.addEventListener(listener,fn,false);
485		}catch(e){
486			elm.attachEvent("on"+listener,fn);
487		}
488	}
489	addEvent(window,"load",heightLine);
490}
491
492
493
494/* =====================================
495	           accordion
496===================================== */
497jQuery(function($) {
498	$('.accordion p').click(function(){
499		if($(this).next('ul').is(':visible')) {
500			$(this).next('ul').slideUp(300);
501			$(this).removeClass('acv_open');
502		} else {
503			$('.accordion ul').slideUp();
504			$('.accordion').find('p').removeClass('acv_open');
505			$(this).next('ul').slideDown(300);
506			$(this).addClass('acv_open');
507		}
508	});
509});
510
511
512/* =====================================
513		 	お問い合わせ
514===================================== */
515$( function() {
516	var index=0;
517	$(".wpcf7-list-item-label").each(function () {
518		index=$(this).parents(".wpcf7-list-item").index();
519		var labelhtml=$(this).html();
520		$(this).html('<label for="check'+index+'" class="icon-check">'+ labelhtml+'</label>');
521	});
522
523	$(".check_box").find(":checkbox").each(function () {
524		index=$(this).parents(".wpcf7-list-item").index();
525		$(this).attr("id","check"+index);
526
527		$(this).parent().find(".wpcf7-list-item-label label").attr("for","check"+index);
528	});
529});
530
531$( function() {
532	$(document).ready(function () {
533		var local_href = window.location.href;
534		var url;
535		if(local_href.indexOf('/contact/')>-1){
536			$('body').addClass('contact');
537		}
538	});
539
540	var $s = $('.wpcf7-confirm'), $c = $(''), $t = $('.wpcf7-validates-as-required');
541	$(".wpcf7-validates-as-required").after('<span class="verify_icon icon-checked"></span>');
542
543	function toggleSubmitClass(flag){
544		$s.prop('disabled', flag);
545		if (flag){
546			$s.addClass('disabled').removeClass('abled').attr( {'value' : '必須項目を入力してください'} );
547		}else{
548			$s.addClass('abled').removeClass('disabled').attr( {'value' : '入力内容を確認する'} );
549		}
550	}
551
552	function ckFlag(){
553		var flag = $t.add($c.filter(':checked')).map(function(i,e){return $(e).val() || null}).length == $t.length + $c.length ;
554		toggleSubmitClass(!flag);
555	}
556	ckFlag();
557	$c.on('click', ckFlag);
558	$t.on('keydown keyup keypress change', ckFlag);
559});
560
561$( function() {
562	var $confirm_btn = $('.wpcf7-confirm');
563	var $back_btn = $('.wpcf7-back');
564	var $submit_btn = $('.wpcf7-submit');
565
566	function confirmBtn(){
567		$(".inquiryFormTable").addClass('verified_table');
568
569		if($(".wpcf7-confirm").hasClass("abled")){
570			$(".inquiryFormTable").addClass('confirm_table');
571
572			var t=setTimeout(function(){ 
573				if($(".wpcf7-form").hasClass("failed")){		   
574					$(".failed .confirm_table input[type='text'], .failed .confirm_table input[type='tel'], .failed .confirm_table input[type='email'], .failed .confirm_table select, .failed .confirm_table textarea, .failed .confirm_table input:checkbox:checked").each(function () {
575						var val=$(this).val();
576						$(this).parent().append('<span class="result_txt">'+val+'</span>');
577					});	
578				} },2000)
579			}
580	}
581	$confirm_btn.on('click', confirmBtn);
582
583	function backBtn(){
584		$(".inquiryFormTable").removeClass('confirm_table');
585		$(".result_txt").remove();
586	}
587	$back_btn.on('click', backBtn);
588
589	function submitBtn(){
590		$(".inquiryFormTable").css("display", "none");
591	}
592	$submit_btn.on('click', submitBtn);
593});
594
595jQuery(document).ready(function(){
596	jQuery('.wpcf7-submit').click(function(e) {
597		$('html,body').animate({scrollTop: $('form').offset().top - 80}, 'slow', null);
598		//$('html,body').animate({scrollTop: position}, 700);
599	});
600});
601
602
603/* =====================================
604	           congestion
605===================================== */
606$(function () {
607	if ($(window).width() < 768) {
608		$("#congestion_iframe_sp").addClass('active');
609		$("#congestion_iframe_pc").removeClass('active');
610		$("#congestion_iframe_pc").empty();
611		$("#congestion_iframe_sp").append('<iframe src="//cdn.innaimachi.jp/widget/v1/widget_default.html?clinic_id=19781&amp;pattern=undefined" width="100%"  frameborder="0" id="ewtd_widget_19781" style="border: 0px;"></iframe>');
612	}
613});
614/*
615 $(window).resize(function() {
616  if ($(window).width() < 768) {
617	   if ($("#congestion_iframe_pc").hasClass("active"))
618	   {
619		   $("#congestion_iframe_sp").addClass('active');
620		   $("#congestion_iframe_pc").removeClass('active');
621		   $("#congestion_iframe_pc").empty();
622		   $("#congestion_iframe_sp").append('<iframe src="//cdn.innaimachi.jp/widget/v1/widget_default.html?clinic_id=19781&amp;pattern=undefined" width="100%"  frameborder="0" id="ewtd_widget_19781" style="border: 0px;"></iframe>');
623	   }
624  }
625 else {
626	 if ($("#congestion_iframe_sp").hasClass("active"))
627	 {
628		 $("#congestion_iframe_pc").addClass('active');
629		 $("#congestion_iframe_sp").removeClass('active');
630		 $("#congestion_iframe_sp").empty();
631		 $("#congestion_iframe_pc").append('<iframe src="//cdn.innaimachi.jp/widget/v1/widget_default.html?clinic_id=19781&amp;pattern=undefined" width="100%"  frameborder="0" id="ewtd_widget_19781" style="border: 0px;"></iframe>');
632	 }
633 }
634 
635});
636*/
637
638
639
640/* =====================================
641・『お問い合わせボタン』をクリック=>btnInq というclassを追加
642・『電話かけるボタン』をクリック=>btnTel というclassを追加
643・『Web予約ボタン』をクリック=>btnReserve というclassを追加
644・『お問い合わせ完了』画面に遷移=>サンクスページに移動したら自動でコンバージョン取得
645===================================== */
646jQuery(function () {
647    $(window).on('load', function () {
648        var beforeURL = document.referrer;
649        var label;
650        var ua = navigator.userAgent;
651        switch (true) {
652            case ua.indexOf("windows") != -1 && ua.indexOf("phone") != -1:
653                ua = 'sp_windowsphone';
654                break;
655            case ua.indexOf("iphone") != -1 || ua.indexOf("iPhone") != -1:
656                ua = 'sp_iphone';
657                break;
658            case ua.indexOf("ipod") != -1:
659                ua = 'mb_ipod';
660                break;
661            case ua.indexOf("android") != -1 && ua.indexOf("mobile") != -1:
662                ua = 'sp_android';
663                break;
664            case ua.indexOf("firefox") != -1 && ua.indexOf("mobile") != -1:
665                ua = 'sp_firefox';
666                break;
667            case ua.indexOf("blackberry") != -1:
668                ua = 'sp_blackberry';
669                break;
670            case ua.indexOf("windows") != -1 && ua.indexOf("touch") != -1:
671                ua = 'tb_windows';
672                break;
673            case ua.indexOf("ipad") != -1 || ua.indexOf("iPad") != -1:
674                ua = 'tb_ipad';
675                break;
676            case ua.indexOf("android") != -1 && ua.indexOf("mobile") == -1:
677                ua = 'tb_android';
678                break;
679            case ua.indexOf("firefox") != -1 && ua.indexOf("tablet") != -1:
680                ua = 'tb_android';
681                break;
682            case ua.indexOf("kindle") != -1:
683                ua = 'tb_kindle';
684                break;
685            case ua.indexOf("silk") != -1:
686                ua = 'tb_silk';
687                break;
688            case ua.indexOf("playbook") != -1:
689                ua = 'tb_playbook';
690                break;
691            default:
692                ua = 'ua_other';
693        }
694
695        switch (true) {
696            case /facebook/.test(beforeURL):
697                beforeURL = "facebook";
698                break;
699            case /yahoo/.test(beforeURL):
700                beforeURL = "yahoo";
701                break;
702            case /adurl/.test(beforeURL):
703                beforeURL = "google";
704                break;
705            default:
706                beforeURL = "その他";
707                break;
708        }
709
710        if (typeof gtag != "undefined") {
711            var device = $(window).width() < 768 ? 'sp' : 'pc';
712            jQuery(".btnInq").on('click', function () {
713                var idx = jQuery(".btnInq").index(this) + 1;
714                var evtAction = jQuery(this).data('evt');
715                gtag('event', `${evtAction}_ページ(${location.pathname})_上から${idx}番目_デバイス${device}`, {
716                    'event_category': 'お問い合わせ',
717                    'event_label': idx + '番目'
718                });
719            });
720            $('a[href^="tel:"]').on('click', function () {
721                var idx = $('a[href^="tel:"]').index(this) + 1;
722                var telNumber = $(this).attr("href").replace("tel:", "");
723                gtag('event', `${telNumber}_ページ(${location.pathname})_上から${idx}番目_デバイス${device}`, {
724                    'event_category': '電話',
725                    'event_label': idx + '番目'
726                });
727            });
728            jQuery(".btnReserve").on('click', function () {
729                var idx = jQuery(".btnReserve").index(this) + 1;
730                var evtAction = jQuery(this).data('evt');
731                gtag('event', `${evtAction}_ページ(${location.pathname})_上から${idx}番目_デバイス${device}`, {
732                    'event_category': 'WEB予約',
733                    'event_label': idx + '番目'
734                });
735            });
736            wpcf7_thanks("gtag");
737        }
738        if (typeof ga != "undefined") {
739            jQuery(".btnInq").on('click', function () {
740                var idx = jQuery(".btnInq").index(this) + 1;
741                var evtAction = jQuery(this).data('evt');
742                ga('send', 'event', 'お問い合わせ', evtAction, idx + '番目');
743            });
744            jQuery(".btnTel").on('click', function () {
745                var idx = jQuery(".btnTel").index(this) + 1;
746                var telNumber = jQuery(this).attr("href");
747                telNumber = telNumber.replace("tel:", "");
748                ga('send', 'event', '電話', telNumber, idx + '番目');
749            });
750            jQuery(".btnReserve").on('click', function () {
751                var idx = jQuery(".btnReserve").index(this) + 1;
752                var evtAction = jQuery(this).data('evt');
753                ga('send', 'event', 'WEB予約', evtAction, idx + '番目');
754            });
755            wpcf7_thanks("ga");
756        }
757        // contact form7 送信完了コンバージョン関数
758        function wpcf7_thanks(tagType) {
759            if (jQuery('.wpcf7')[0]) {
760                jQuery('.wpcf7').on('wpcf7mailsent', function () {
761                    if (jQuery(".wpcf7-form.sent")[0]) {
762                        switch (tagType) {
763                            case "ga":
764                                ga('send', 'event', 'お問い合わせ', 'ロード', 'サンクスページ');
765                                break;
766                            case "gtag":
767                                gtag('event', 'click', {
768                                    'event_category': 'お問い合わせ',
769                                    'event_label': 'サンクスページ'
770                                });
771                                break;
772                            default:
773                                ga('send', 'event', 'お問い合わせ', 'ロード', 'サンクスページ');
774                                break;
775                        }
776                    }
777                });
778            }
779        }
780    });
781});
782
783
784
785
786
787
788
789/* =====================================
790・『お問い合わせボタン』をクリック=>btnInq というclassを追加
791・『電話かけるボタン』をクリック=>btnTel というclassを追加
792・『Web予約ボタン』をクリック=>btnReserve というclassを追加
793・『お問い合わせ完了』画面に遷移=>サンクスページに移動したら自動でコンバージョン取得
794===================================== */
795// $(function(){
796//   var beforeURL = document.referrer;
797//   var label;
798//   var ua = navigator.userAgent;
799//   switch(true) {
800//     case ua.indexOf("windows") != -1 && ua.indexOf("phone") != -1:
801//       ua = 'sp_windowsphone';
802//       break;
803//     case ua.indexOf("iphone") != -1 || ua.indexOf("iPhone") != -1:
804//       ua = 'sp_iphone';
805//       break;
806//     case ua.indexOf("ipod") != -1:
807//       ua = 'mb_ipod';
808//       break;
809//     case ua.indexOf("android") != -1 && ua.indexOf("mobile") != -1:
810//       ua = 'sp_android';
811//       break;
812//     case ua.indexOf("firefox") != -1 && ua.indexOf("mobile") != -1:
813//       ua = 'sp_firefox';
814//       break;
815//     case ua.indexOf("blackberry") != -1:
816//       ua = 'sp_blackberry';
817//       break;
818//     case ua.indexOf("windows") != -1 && ua.indexOf("touch") != -1:
819//       ua = 'tb_windows';
820//       break;
821//     case ua.indexOf("ipad") != -1 || ua.indexOf("iPad") != -1:
822//       ua = 'tb_ipad';
823//       break;
824//     case ua.indexOf("android") != -1 && ua.indexOf("mobile") == -1:
825//       ua = 'tb_android';
826//       break;
827//     case ua.indexOf("firefox") != -1 && ua.indexOf("tablet") != -1:
828//       ua = 'tb_android';
829//       break;
830//     case ua.indexOf("kindle") != -1:
831//       ua = 'tb_kindle';
832//       break;
833//     case ua.indexOf("silk") != -1:
834//       ua = 'tb_silk';
835//       break;
836//     case ua.indexOf("playbook") != -1:
837//       ua = 'tb_playbook';
838//       break;
839//     default:
840//       ua = 'ua_other'
841//   }
842//   switch(true) {
843//     case /facebook/.test(beforeURL):
844//       beforeURL = "facebook";
845//       break;
846//     case /yahoo/.test(beforeURL):
847//       beforeURL = "yahoo";
848//       break;
849//     case /adurl/.test(beforeURL):
850//       beforeURL = "google";
851//       break;
852//     default:
853//       beforeURL = "その他";
854//       break;
855//   }
856//   $(".btnInq").on('click', function(){
857//     var idx = $(".btnInq").index(this)+1;
858//     ga('send', 'event', 'お問い合わせ', 'クリック', idx+'番目');
859//   });
860//   $(".btnTel").on('click', function(){
861//     var idx = $(".btnTel").index(this)+1;
862//     console.log(idx+"and"+ua+"and"+beforeURL);
863//     ga('send', 'event', '電話', 'クリック', idx+'番目');
864//   });
865//   $(".btnReserve").on('click', function(){
866//     var idx = $(".btnReserve").index(this)+1;
867//     ga('send', 'event', 'WEB予約', 'クリック', idx+'番目');
868//   });
869//   // お問い合わせサンクスページへのボタン
870//   if($('.wpcf7')[0]) {
871//     $('.wpcf7').on('wpcf7submit', function() {
872//       if(!$(".wpcf7-form.invalid")[0]) {
873//         //if(!$(".forms").hasClass("confirm")) {
874//           ga('send', 'event', 'お問い合わせ', 'ロード', 'サンクスページ');
875//         //}
876//       }
877//     });
878//   }
879// });

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.