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
5854ef1372
commit
bba6860a08
@ -251,14 +251,14 @@ function router() {
|
|||||||
var perc = ditto.save_progress ? store.get('page-progress') || 0 : 0;
|
var perc = ditto.save_progress ? store.get('page-progress') || 0 : 0;
|
||||||
|
|
||||||
if(location.hash !== '' || Boolean(perc)){
|
if(location.hash !== '' || Boolean(perc)){
|
||||||
if (ditto.save_progress && store.get('menu-progress') !== location.hash){
|
if (!Boolean(perc){
|
||||||
$('html, body').animate({
|
$('html, body').animate({
|
||||||
scrollTop: $('#content').offset().top
|
scrollTop: $('#content').offset().top
|
||||||
}, 200);
|
}, 200);
|
||||||
console.log('no perc');
|
console.log('no perc');
|
||||||
} else {
|
} else {
|
||||||
$('html, body').animate({
|
$('html, body').animate({
|
||||||
scrollTop: Boolean(perc)?($('body').height()-$(window).height())*perc:$('#content').offset().top
|
scrollTop: ($('body').height()-$(window).height())*perc
|
||||||
}, 200);
|
}, 200);
|
||||||
console.log('perc');
|
console.log('perc');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user