1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-25 03:02:21 +00:00

fix: 无法解析中文编码的hash

This commit is contained in:
ruanyf 2016-02-27 19:55:46 +08:00
parent b77c044003
commit 74118a5447

View File

@ -329,7 +329,7 @@ function router() {
if (sectionId) { if (sectionId) {
$('html, body').animate({ $('html, body').animate({
scrollTop: ($('#' + sectionId).offset().top) scrollTop: ($('#' + decodeURI(sectionId)).offset().top)
}, 300); }, 300);
} else { } else {
if (location.hash !== '' || Boolean(perc)) { if (location.hash !== '' || Boolean(perc)) {