mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-24 10:22:23 +00:00
edit js/ditto
This commit is contained in:
parent
293fe6229a
commit
23ddcbebee
12
js/ditto.js
12
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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user