fix progress bar

This commit is contained in:
ruanyf
2015-10-14 20:54:57 +08:00
parent ba19987cdb
commit 62f987c4cc
+6 -3
View File
@@ -252,13 +252,16 @@ function router() {
})();
})();
var perc = ditto.save_progress ? store.get('page-progress') || 0 : 0;
var perc = ditto.save_progress ? store.get('page-progress') || 0 : 0;
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