We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e59fe64 commit 436e134Copy full SHA for 436e134
1 file changed
source/js/animation.js
@@ -52,8 +52,11 @@
52
// jump to location.hash
53
if (window.location.hash) {
54
setTimeout(() => {
55
- // Use getElementById because querySelector does not support ids that start with numbers
56
- document.getElementById(window.location.hash.substring(1)).scrollIntoView({ behavior: 'smooth' });
+ const id = '#' + CSS.escape(window.location.hash.substring(1));
+ const target = document.querySelector(id);
57
+ if (target) {
58
+ target.scrollIntoView({ behavior: 'smooth' });
59
+ }
60
}, i * 100);
61
}
62
});
0 commit comments