ヘッダーにはid名「header」を指定。
即時関数と厳格モードは必要に応じて消せ消せ消せ消せ(´・ω・`)
(() => {
'use strict';
jQuery( window ).on( 'load', function() {
const headerH = Math.floor( headerH = $( '#header' ).height() );
const url_hash = jQuery( location ).attr( 'hash' );
if( url_hash ) {
const pos = !jQuery( url_hash ) ? 0 : jQuery( url_hash ).offset().top - headerH;
jQuery( window ).scrollTop( pos );
}
});
})()