PageSourceSearch

https://miura-lc.or.jp/wp/wp-content/themes/system-template/js/main.js

js miura-lc.or.jp collected 2026-10-06 08:11:44 UTC 3,088 bytes, 121 lines download raw bytes

1$(function () {
2/******************************
3telリンク処理
4******************************/
5$(function() {
6  var ua = navigator.userAgent.toLowerCase();
7  var isMobile = /iphone/.test(ua)||/android(.+)?mobile/.test(ua);
8
9  if (!isMobile) {
10    $('a[href^="tel:"]').on('click', function(e) {
11      e.preventDefault();
12    });
13  }
14});
15/******************************
16SP電話ポップ
17******************************/
18$('.tel_btn').on("click", function () {
19    $('#tel_modal').toggleClass('open');
20});
21$('.modal_btn').on("click", function () {
22    $('#tel_modal').toggleClass('open');
23});
24/******************************
25pagetop
26******************************/
27var topBtn = $('.pagetop');
28topBtn.hide();
29$(window).scroll(function () {
30	if ($(this).scrollTop() > 100) {
31		topBtn.fadeIn();
32	} else {
33		topBtn.fadeOut();
34	}
35});
36//スクロールしてトップ
37topBtn.click(function () {
38	$('body,html').animate({
39		scrollTop: 0
40	}, 500);
41	return false;
42});
43/******************************
44fixHeader
45******************************/
46var $nav = $('nav'),
47navHead = $nav.offset().top;
48$(window).on("scroll", function () {
49//scrollTopの値の分スクロールしたらナビに.fixedが追加される。
50if ($(this).scrollTop() > navHead) {
51    $nav.addClass('fixed');
52 
53    
54} else {
55    $nav.removeClass('fixed');
56
57}
58});
59/******************************
60slideDownNavi2
61******************************/
62$("nav li").hover(
63	function () {
64		$(this).children('div').stop().slideDown(90);
65		$(this).addClass("active2");
66	},
67	function () {
68		$(this).children('div').stop().slideUp(90);
69		$(this).removeClass("active2");
70	});
71});
72/******************************
73アンカーリンク
74******************************/
75//var headerHeight = $('header').outerHeight();
76var headerHeight = 100;
77var urlHash = location.hash;
78if(urlHash) {
79    $('body,html').stop().scrollTop(0);
80    setTimeout(function(){
81        var target = $(urlHash);
82        var position = target.offset().top - headerHeight;
83        $('body,html').stop().animate({scrollTop:position}, 500);
84    }, 100);
85}
86$('a[href^="#"]').click(function() {
87    var href= $(this).attr("href");
88    var target = $(href);
89    var position = target.offset().top - headerHeight;
90    $('body,html').stop().animate({scrollTop:position}, 500);
91});
92
93var defaultQueryList = {
94	mobile: matchMedia("(max-width: 640px)"),
95	pc: matchMedia("(min-width: 641px)")
96}
97
98function routingByBreakpoint(sourceList) {
99	for (var i = 0, l = sourceList.length; i < l; i++) {
100		var source = sourceList[i];
101
102		if (!(source.dataset.query && defaultQueryList[source.dataset.query] && source.dataset.src)) continue;
103		if (!(defaultQueryList[source.dataset.query].matches)) continue;
104
105		var newSource = document.createElement("source");
106		newSource.src = source.dataset.src;
107
108		source.parentElement.appendChild(newSource);
109	}
110}
111
112(function () {
113	var elemList = document.getElementsByClassName("routingByBreakpoint");
114
115	for (var i = 0, l = elemList.length; i < l; i++) {
116		var sourceList = elemList[i].getElementsByTagName("source");
117
118		routingByBreakpoint(sourceList);
119	}
120
121})();

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.