From 23ddcbebee5a346ade939e022093e70da49148c4 Mon Sep 17 00:00:00 2001 From: ruanyf Date: Tue, 29 Apr 2014 10:21:51 +0800 Subject: [PATCH] edit js/ditto --- js/ditto.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/ditto.js b/js/ditto.js index 73fef7e..5c36f4c 100644 --- a/js/ditto.js +++ b/js/ditto.js @@ -170,6 +170,11 @@ function show_loading() { } function router() { + + $('html, body').animate({ + scrollTop: $('#content').offset().top + }, 200); + var path = location.hash.replace("#", "./"); // default page if hash is empty @@ -196,6 +201,7 @@ function router() { normalize_paths(); create_page_anchors(); + // 完成代码高亮 $('#content code').map(function() { Prism.highlightElement(this); }); @@ -216,12 +222,6 @@ function router() { })(); })(); - if(path.indexOf('README') === -1){ - $('html, body').animate({ - scrollTop: $('#content').offset().top - }, 200); - } - }).fail(function() { show_error();