1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-24 18:32:22 +00:00

fix progress bar

This commit is contained in:
ruanyf 2015-10-14 20:54:57 +08:00
parent ba19987cdb
commit 62f987c4cc

View File

@ -257,8 +257,11 @@ function router() {
if(location.hash !== '' || Boolean(perc)){
if (!Boolean(perc)){
$('html, body').animate({
scrollTop: $('#content').offset().top
}, 200);
scrollTop: ($('#content').offset().top + 10)
}, 300);
$('html, body').animate({
scrollTop: ($('#content').offset().top)
}, 300);
} else {
$('html, body').animate({
scrollTop: ($('body').height()-$(window).height())*perc