Fix smooth scroll (#164)
The function addSmoothScroll causes an error if a target link contains multibyte characters. Decoding `this.hash` can prevent.
This commit is contained in:
parent
38fdbbfbdb
commit
6c03dd74af
1 changed files with 1 additions and 1 deletions
|
@ -37,7 +37,7 @@ var isMobile = false, isTablet = false, isLaptop = false;
|
||||||
location.hostname == this.hostname
|
location.hostname == this.hostname
|
||||||
) {
|
) {
|
||||||
// Figure out element to scroll to
|
// Figure out element to scroll to
|
||||||
var target = $(this.hash);
|
var target = $(decodeURI(this.hash));
|
||||||
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
|
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
|
||||||
// Does a scroll target exist?
|
// Does a scroll target exist?
|
||||||
if (target.length) {
|
if (target.length) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue