Skip to content

Commit

Permalink
Update collapse.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ruehlef committed Aug 16, 2023
1 parent 82304a3 commit be60d2f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion script/collapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,13 @@ for (i = 0; i < coll.length; i++) {
}

/* code to make hash work in safari, i.e. jump to correct seminar series */
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}

window.onload = function() {
if(location.hash != "") {
await new Promise(r => setTimeout(r, 2000));
sleep(2000);
const element = document.getElementById(location.hash.substring(1));
element.scrollIntoView(true);
}
Expand Down

0 comments on commit be60d2f

Please sign in to comment.