Skip to content

Commit 62f987c

Browse files
committed
fix progress bar
1 parent ba19987 commit 62f987c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

js/ditto.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,13 +252,16 @@ function router() {
252252
})();
253253
})();
254254

255-
var perc = ditto.save_progress ? store.get('page-progress') || 0 : 0;
255+
var perc = ditto.save_progress ? store.get('page-progress') || 0 : 0;
256256

257257
if(location.hash !== '' || Boolean(perc)){
258258
if (!Boolean(perc)){
259259
$('html, body').animate({
260-
scrollTop: $('#content').offset().top
261-
}, 200);
260+
scrollTop: ($('#content').offset().top + 10)
261+
}, 300);
262+
$('html, body').animate({
263+
scrollTop: ($('#content').offset().top)
264+
}, 300);
262265
} else {
263266
$('html, body').animate({
264267
scrollTop: ($('body').height()-$(window).height())*perc

0 commit comments

Comments
 (0)