1

我将 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();
        });
    }
});

希望你能帮助我,我会很感激任何帮助。

4

1 回答 1

0

你可以试试这样的

xpScroll.on('scrollEnd', function(){
    var scrollY = xpScroll.y + 15;
    var scrollH = $('.xp-scroll').height() - $(window).height();
    var scrollEnd = scrollH + scrollY;

    if (scrollEnd == 0) {
        alert('End');
    }
});

http://jsfiddle.net/fF4BJ/1/ 在你的小提琴中为我工作。向上滚动使用你的数学技能。

于 2014-04-16T01:17:58.757 回答