0
我正在使用turn.js和jquery創建翻頁書。當鼠標向上或向下滾動時,我想翻頁。它的工作非常好。但問題是它只能在頁面上的可用瀏覽器空間中滾動單個或雙個頁面。鼠標滾動事件只在可用空間中工作
這是我的鏈接。
http://sajidshah.com/proof/flippingbook/index.php?direction=rtl#page/4
並且代碼。
$(function(){
//Keep track of last scroll
var lastScroll = 0;
$(window).scroll(function(event){
//Sets the current scroll position
var st = $(this).scrollTop();
//Determines up-or-down scrolling
if (st > lastScroll){
next();
event.preventDefault();
}
else {
previous();
event.preventDefault();
}
//Updates scroll position
lastScroll = st;
});
});
僱主是使用jQuery。在這種情況下:'$(window).on(「mousewheel」,...)''evt.originalEvent.deltaX | Y | Z' –