PluginProbe ʕ •ᴥ•ʔ
SEO SIMPLE PACK / 2.2.3
SEO SIMPLE PACK v2.2.3
1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 2.0.0 2.1.0 2.1.1 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 2.4.0 2.4.1 2.4.2 2.5.0 2.5.1 3.0.0 3.1.0 3.1.1 3.1.2 3.2.0 3.2.1 3.3.0 3.3.1 3.4.0 3.5.0 3.5.1 3.5.2 3.6.0 3.6.1 3.6.2 3.6.3 3.7.0 trunk 1.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2
seo-simple-pack / src / js / ssp.js
seo-simple-pack / src / js Last commit date
common.js 5 years ago mediauploader.js 5 years ago ssp.js 5 years ago
ssp.js
52 lines
1 /**
2 * scripts
3 */
4 addEventListener('DOMContentLoaded', function () {
5
6 // 設定タブの切替処理
7 (function () {
8 // ページ上部へ
9 window.scrollTo(0, 0);
10
11 const tabNavs = document.querySelectorAll('.nav-tab');
12 const tabContents = document.querySelectorAll('.tab-contents');
13
14 if (location.hash) {
15 const hashTarget = document.querySelector(location.hash);
16 const hashTab = document.querySelector(
17 '[href="' + location.hash + '"]'
18 );
19 const actTabNav = document.querySelector('.nav-tab.act_');
20 const actTabContent = document.querySelector('.tab-contents.act_');
21 if (hashTarget && hashTab && actTabNav && actTabContent) {
22 actTabNav.classList.remove('act_');
23 actTabContent.classList.remove('act_');
24 hashTarget.classList.add('act_');
25 hashTab.classList.add('act_');
26 }
27 }
28
29 for (let i = 0; i < tabNavs.length; i++) {
30 tabNavs[i].addEventListener('click', function (e) {
31 e.preventDefault();
32 const targetHash = e.target.getAttribute('href');
33
34 // History APIでURLを書き換える( location.hash でやると 移動してしまう)
35 history.replaceState(null, null, targetHash);
36
37 if (!tabNavs[i].classList.contains('act_')) {
38 document
39 .querySelector('.nav-tab.act_')
40 .classList.remove('act_');
41 tabNavs[i].classList.add('act_');
42
43 document
44 .querySelector('.tab-contents.act_')
45 .classList.remove('act_');
46 tabContents[i].classList.add('act_');
47 }
48 });
49 }
50 })();
51 });
52