From 0981b07f0b3fb0ce2ae147913092be0c28fcdfa1 Mon Sep 17 00:00:00 2001 From: ruanyf Date: Tue, 22 Apr 2014 09:55:12 +0800 Subject: [PATCH] add hashchange animation --- js/ditto.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/ditto.js b/js/ditto.js index a3315dc..fd74623 100644 --- a/js/ditto.js +++ b/js/ditto.js @@ -196,6 +196,11 @@ function router() { $('#content code').map(function() { Prism.highlightElement(this); }); + + $('html, body').animate({ + scrollTop: $('#content').offset().top + }, 200); + }).fail(function() { show_error();