我将 iScroll 5 与 fullpage.js 一起使用,因为 fullpage.js 提供的解决方案不是我需要的。
我的页面有 3 个整页部分。第二部分有一个垂直滚动的内容。
我需要做的是检测我的可滚动内容何时位于父元素的边界(顶部和底部),然后如果我再次执行滚动(鼠标滚轮或触摸),它会触发一个事件。
这是一个解决问题的小提琴。
我需要这样的东西:
$('.scrollwrapper').on("mousewheel touchmove", function() {
if ("scroll is on max top"){
$(this).on("wheelUp touchmoveUp", function() {
$.fn.fullpage.moveSectionUp();
});
}else if ("scroll is on max bottom"){
$(this).on("wheelDown touchmoveDown", function() {
$.fn.fullpage.moveSectionDown();
});
}
});
希望你能帮助我,我会很感激任何帮助。