Original Commit

This commit is contained in:
Michael Nolan 2022-10-17 08:55:51 +00:00
parent 1dff93db1d
commit c5c3596a73
1 changed files with 16 additions and 0 deletions

16
js/spa.js Normal file
View File

@ -0,0 +1,16 @@
addEventListener('hashchange', (event) => {
setPage();
});
function setPage(){
document.querySelectorAll('.spapage').forEach(e=>{
e.hidden=true;
});
var hash=window.location.hash.replace('#','');
if(hash.length === 0)
{
hash="index";
}
document.getElementById(hash).hidden=false;
}
setPage();