Skip to content

Commit

Permalink
Ensures back button in browser goes back to tree.
Browse files Browse the repository at this point in the history
Refs #9.
  • Loading branch information
jeremyboggs committed Nov 7, 2024
1 parent 4d499ea commit 34c666b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
20 changes: 19 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,25 @@ <h2>Make Learning a Playful Process</h2>

<script>

console.log('Hello, world!');
var sections = document.querySelectorAll('section');

sections.forEach(function(s) {
console.log(s.id);
});

window.addEventListener('load', function() {
hash = window.location.hash;
hash = hash.substring(1);
if (hash) {
sections.forEach(function(i) {
i.style.display = 'none';
});

var currentSection = document.getElementById(hash);
currentSection.style.display = 'block';
}
});

var preamble = document.querySelector('#preamble');
var charter = document.querySelector('#charter');
charter.style.display = 'none';
Expand Down
1 change: 0 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ nav a {
height: 70px;
position: absolute;
transition: transform .25s ease-in-out;

}

nav a:hover {
Expand Down

0 comments on commit 34c666b

Please sign in to comment.