From 62f987c4cc541f8572e378a65fd68aa277e972c0 Mon Sep 17 00:00:00 2001 From: ruanyf Date: Wed, 14 Oct 2015 20:54:57 +0800 Subject: [PATCH] fix progress bar --- js/ditto.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/js/ditto.js b/js/ditto.js index fa4a620..a0b815d 100644 --- a/js/ditto.js +++ b/js/ditto.js @@ -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