Call Resize
リサイズ イベントハンドラ
使い方
JavaScript版あり。
JavaScript版ではCSS変数を使用。
$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));// ページ読み込み時のイベント登録*/