From ad17303a0375e8051386eb65b2e30f0cb2ff837c Mon Sep 17 00:00:00 2001 From: ruanyf Date: Tue, 22 Apr 2014 10:02:25 +0800 Subject: [PATCH] add hashchange animation --- js/ditto.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/ditto.js b/js/ditto.js index fd74623..97a5cc2 100644 --- a/js/ditto.js +++ b/js/ditto.js @@ -197,9 +197,11 @@ function router() { Prism.highlightElement(this); }); - $('html, body').animate({ - scrollTop: $('#content').offset().top - }, 200); + if(path.indexOf('README') !== -1){ + $('html, body').animate({ + scrollTop: $('#content').offset().top + }, 200); + } }).fail(function() { show_error();