mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2024-04-21 12:32:22 +00:00
add page flip
This commit is contained in:
+10
@@ -39,6 +39,16 @@ function initialize() {
|
||||
// page router
|
||||
router();
|
||||
$(window).on('hashchange', router);
|
||||
$(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;
|
||||
});
|
||||
}
|
||||
|
||||
function init_sidebar_section() {
|
||||
|
||||
Reference in New Issue
Block a user