PageSourceSearch

https://www.dyn.co.jp/wp-content/themes/dyntemplate/js/customize-footer.js

js dyn.co.jp collected 2026-09-24 12:08:16 UTC 921 bytes, 21 lines download raw bytes

1
2/*-------------------------------------------------------
3    スマホの時だけtelリンクを有効にする
4-------------------------------------------------------*/
5document.addEventListener('DOMContentLoaded', function () {
6	const isMobile = window.innerWidth <= 768; // 画面幅でスマホ判定
7
8	if (isMobile) {
9		document.querySelectorAll('.tellink').forEach(function (el) {
10			const text = el.textContent.trim(); // 要素の中にある電話番号を取得して前後の空白を削除
11			const tel = text.replace(/-/g, ''); // 電話番号からハイフンを全部削除
12			const a = document.createElement('a'); // <a> リンク作成
13			a.href = 'tel:' + tel; // tel:付与
14			a.textContent = text; // 表示されるリンクのテキストを元の電話番号と同じに
15			el.innerHTML = ''; // 元のテキストを消す
16			el.appendChild(a); // <a> 要素を中に入れる
17		});
18	}
19});
20
21

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.