1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-24 18:32:22 +00:00

edit js/ditto

This commit is contained in:
ruanyf 2014-04-29 10:21:51 +08:00
parent 293fe6229a
commit 23ddcbebee

View File

@ -170,6 +170,11 @@ function show_loading() {
} }
function router() { function router() {
$('html, body').animate({
scrollTop: $('#content').offset().top
}, 200);
var path = location.hash.replace("#", "./"); var path = location.hash.replace("#", "./");
// default page if hash is empty // default page if hash is empty
@ -196,6 +201,7 @@ function router() {
normalize_paths(); normalize_paths();
create_page_anchors(); create_page_anchors();
// 完成代码高亮
$('#content code').map(function() { $('#content code').map(function() {
Prism.highlightElement(this); Prism.highlightElement(this);
}); });
@ -216,12 +222,6 @@ function router() {
})(); })();
})(); })();
if(path.indexOf('README') === -1){
$('html, body').animate({
scrollTop: $('#content').offset().top
}, 200);
}
}).fail(function() { }).fail(function() {
show_error(); show_error();