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:
parent
65206f8905
commit
e277c06bb5
29
js/ditto.js
29
js/ditto.js
@ -48,6 +48,20 @@ function init_sidebar_section() {
|
|||||||
menuOL.find('li a').map(function(){
|
menuOL.find('li a').map(function(){
|
||||||
menu.push(this.href.slice(this.href.indexOf('#')));
|
menu.push(this.href.slice(this.href.indexOf('#')));
|
||||||
});
|
});
|
||||||
|
$('#pageup').on('click',function (){
|
||||||
|
for (var i=0;i<menu.length;i++){
|
||||||
|
if (location.hash==='') break;
|
||||||
|
if (menu[i]===location.hash) break;
|
||||||
|
}
|
||||||
|
location.hash = menu[i-1]
|
||||||
|
});
|
||||||
|
$('#pagedown').on('click',function (){
|
||||||
|
for (var i=0;i<menu.length;i++){
|
||||||
|
if (location.hash==='') break;
|
||||||
|
if (menu[i]===location.hash) break;
|
||||||
|
}
|
||||||
|
location.hash = menu[i+1];
|
||||||
|
});
|
||||||
}, "text").fail(function() {
|
}, "text").fail(function() {
|
||||||
alert("Opps! can't find the sidebar file to display!");
|
alert("Opps! can't find the sidebar file to display!");
|
||||||
});
|
});
|
||||||
@ -244,21 +258,6 @@ function router() {
|
|||||||
$('#pagedown').css('display','inline-block');
|
$('#pagedown').css('display','inline-block');
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#pageup').on('click',function (){
|
|
||||||
for (var i=0;i<menu.length;i++){
|
|
||||||
if (location.hash==='') break;
|
|
||||||
if (menu[i]===location.hash) break;
|
|
||||||
}
|
|
||||||
location.hash = menu[i-1]
|
|
||||||
});
|
|
||||||
$('#pagedown').on('click',function (){
|
|
||||||
for (var i=0;i<menu.length;i++){
|
|
||||||
if (location.hash==='') break;
|
|
||||||
if (menu[i]===location.hash) break;
|
|
||||||
}
|
|
||||||
location.hash = menu[i+1];
|
|
||||||
});
|
|
||||||
|
|
||||||
}).fail(function() {
|
}).fail(function() {
|
||||||
show_error();
|
show_error();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user