mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-24 18:32:22 +00:00
add page flip
This commit is contained in:
parent
74e232b220
commit
63c9c93411
10
js/ditto.js
10
js/ditto.js
@ -234,15 +234,5 @@ function router() {
|
|||||||
}).always(function() {
|
}).always(function() {
|
||||||
clearInterval(loading);
|
clearInterval(loading);
|
||||||
$(ditto.loading_id).hide();
|
$(ditto.loading_id).hide();
|
||||||
$(document).on('scroll', function (evt) {
|
|
||||||
var newScroll = $(document).scrollTop(),
|
|
||||||
diff = newScroll-lastScroll;
|
|
||||||
treshold = (treshold+diff>headerHeight) ? headerHeight : treshold+diff;
|
|
||||||
treshold = (treshold < 0) ? 0 : treshold;
|
|
||||||
|
|
||||||
header.css('bottom', (-treshold)+'px');
|
|
||||||
|
|
||||||
lastScroll = newScroll;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user