Call Resize

リサイズ イベントハンドラ

詳しい導入事例は導入方法を参照してください。

使い方

JavaScript版あり。
JavaScript版ではCSS変数を使用。

  • Script
$win.on('resize', function(){
  let st = $win.scrollTop();
});

/*const style = getComputedStyle(document.documentElement);
const breakpoint = style.getPropertyValue('--breakpoint-xs');
const mediaQuery = window.matchMedia('(max-width: ${breakpoint})');
const mediaQueryFunction = (event) => {
  if (event.matches) {
    //アクション
  } else {
    //アクション
  }
};
mediaQuery.addEventListener('change', mediaQueryFunction);// ブレイクポイントが変わった時のイベント登録
window.addEventListener('DOMContentLoaded', () => mediaQueryFunction(mediaQueryList));// ページ読み込み時のイベント登録*/