タブ

HTML

<div class="tab-area">
 <div class="tab active">
   タブ1
 </div>
 <div class="tab">
   タブ2
 </div>
 <div class="tab">
   タブ3
 </div>
</div>
<div class="content-area">
 <div class="content show">
   タブ1コンテンツ
 </div>
 <div class="content">
   タブ2コンテンツ
 </div>
 <div class="content">
   タブ3コンテンツ
 </div>
</div>

SCSS

.tab-area {
  display: flex;
  .tab {
    align-items: center;
    border: 1px solid #000;
    color: #000;
    cursor: pointer;
    display: flex;
    justify-content: center;
  }
  .tab.active {
    background-color: #000;
    color: #fff;
  }
}
.content-area {
  .content {
    display: none;
  }
  .content.show {
    display: block;
  }
}

jQuery

$(function () {
  let tabs = $(".tab");
  $(".tab").on("click", function () {
    $(".active").removeClass("active");
    $(this).addClass("active");
    const index = tabs.index(this);
    $(".content").removeClass("show").eq(index).addClass("show");
  });
});

パラメータを外部に引き継ぐ方法

domainsToDecorateにドメイン名を書き、

queryParamsに引き継ぎたいパラメータを書くだけ。

<script>
(function() {
  var domainsToDecorate = [
          'domain1.com', //add or remove domains (without https or trailing slash)
          'domain2.net'
      ],
      queryParams = [
          'utm_medium', //add or remove query parameters you want to transfer
          'utm_source',
          'utm_campaign',
          'something_else'
      ]
  // do not edit anything below this line
  var links = document.querySelectorAll('a'); 

// check if links contain domain from the domainsToDecorate array and then decorates
  for (var linkIndex = 0; linkIndex < links.length; linkIndex++) {
      for (var domainIndex = 0; domainIndex < domainsToDecorate.length; domainIndex++) { 
          if (links[linkIndex].href.indexOf(domainsToDecorate[domainIndex]) > -1 && links[linkIndex].href.indexOf("#") === -1) {
              links[linkIndex].href = decorateUrl(links[linkIndex].href);
          }
      }
  }
// decorates the URL with query params
  function decorateUrl(urlToDecorate) {
      urlToDecorate = (urlToDecorate.indexOf('?') === -1) ? urlToDecorate + '?' : urlToDecorate + '&';
      var collectedQueryParams = [];
      for (var queryIndex = 0; queryIndex < queryParams.length; queryIndex++) {
          if (getQueryParam(queryParams[queryIndex])) {
              collectedQueryParams.push(queryParams[queryIndex] + '=' + getQueryParam(queryParams[queryIndex]))
          }
      }
      return urlToDecorate + collectedQueryParams.join('&');
  }

  // borrowed from https://stackoverflow.com/questions/831030/
  // a function that retrieves the value of a query parameter
  function getQueryParam(name) {
      if (name = (new RegExp('[?&]' + encodeURIComponent(name) + '=([^&]*)')).exec(window.location.search))
          return decodeURIComponent(name[1]);
  }

})();
</script>

動画オリジナルコントローラー

<video id="video01" src="movie.mp4" autoplay muted loop controls playsinline></video>
<div class="control">
<divid="play" class="hidden"><iclass="fa fa-play"></i></div>
<divid="stop"><iclass="fa fa-pause"></i></div>
<divid="mute"><iclass="fa fa-volume-off"></i><iclass="fa fa-volume-up hidden"></i></div>
</div>
<!-- /.control -->
    $(function() {
        // 操作対象のvideoを指定
        var video = $('#video01').get(0);
        // 動画の再生 
        $('#play').click(function() {
            $('#play').addClass('hidden');
            $('#stop').removeClass('hidden');
            video.play();
        });
        // 動画の一時停止
        $('#stop').click(function() {
            $('#play').removeClass('hidden');
            $('#stop').addClass('hidden');
            video.pause();
        });
        // 動画の頭出し(任意の秒へ移動)
        $('#atama').click(function() {
            video.currentTime = 0; // 入れた秒の位置へ移動(例は0秒)
        });
        // 音声ミュート(トグル式)
        $('#mute').click(function() {
            if (video.muted) {
                video.muted = false;
                $('#mute .fa-volume-off').addClass('hidden');
                $('#mute .fa-volume-up').removeClass('hidden');
            } else {
                video.muted = true;
                $('#mute .fa-volume-off').removeClass('hidden');
                $('#mute .fa-volume-up').addClass('hidden');
            }
        });
        //音量アップ
        $('#vol-up').click(function() {
            if (video.volume &lt;= 0.75) {
                video.volume = video.volume + 0.25;
                $("#vol").text(video.volume);
            }
        });
        //音量ダウン
        $('#vol-down').click(function() {
            video.volume = video.volume - 0.25;
            $("#vol").text(video.volume);
        });
        //音量表示
        $("#vol").text(video.volume);
    });

画面幅によって読み込みファイルを変える〜レスポンシブウェブデザイン

<script>
  jQuery(document).ready(function($) {
    //PC環境の場合
    if (window.matchMedia('(min-width: 768px)').matches) { //切り替える画面サイズ
      $.ajax({
        url: '<?php echo esc_url( get_template_directory_uri() ); ?>/js/pc.js',
        dataType: 'script',
        cache: false
      });
      //スマホ環境の場合
    } else {
      $.ajax({
        url: '<?php echo esc_url( get_template_directory_uri() ); ?>/js/sp.js',
        dataType: 'script',
        cache: false
      });
    };
  });
</script>

【CSS】height: 100vh;を確実にする

.my-element {
  min-height: 100vh; /* 変数をサポートしていないブラウザのフォールバック */
  min-height: calc(var(--vh, 1vh) * 100);
}
const setFillHeight = () => {
  const vh = window.innerHeight * 0.01;
  document.documentElement.style.setProperty('--vh', `${vh}px`);
}

let vw = window.innerWidth;

window.addEventListener('resize', () => {
  if (vw === window.innerWidth) {
   // 画面の横幅にサイズ変動がないので処理を終える
    return;
  }

  // 画面の横幅のサイズ変動があった時のみ高さを再計算する
  vw = window.innerWidth;
  setFillHeight();
});

// 初期化
setFillHeight();

【JavaScript】指定した期間中だけ表示を変えたい

<script>
<!--
window.onload = function() {
var now = new Date();
var start = new Date('2001/1/1 0:00:00'); // 表示開始日時
var end = new Date('2020/12/31 23:59:59'); // 表示終了日時
 
if ( start <  now && now < end ) {
    document.getElementById("campaign").style.display="block";
}
}
-->
</script>

<div id="campaign" style="display: none;">
ここに表示させたい内容を書き込む
</div>