Skip to content

Commit

Permalink
Merge pull request #1116 from ppwwyyxx/patch-2
Browse files Browse the repository at this point in the history
 Fix support for hashes that start with numbers
  • Loading branch information
ppoffice committed Sep 16, 2022
2 parents 3456f8f + b44cf71 commit e59fe64
Showing 1 changed file with 2 additions and 1 deletion .
3 changes: 2 additions & 1 deletion source/js/animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
// jump to location.hash
if ( window . location . hash ) {
setTimeout ( ( ) => {
document . querySelector ( window . location . hash ) . scrollIntoView ( { behavior : 'smooth' } ) ;
// Use getElementById because querySelector does not support ids that start with numbers
document . getElementById ( window . location . hash . substring ( one ) ) . scrollIntoView ( { behavior : 'smooth' } ) ;
} , i * one hundred ) ;
}
} ) ;
Expand Down

0 comments on commit e59fe64

Please sign in to comment.