#578·waypoints

Work with https://github.com/idiotWu/smooth-scrollbar

Author: adamwright32Created Oct 9, 2017Updated Jul 30, 2024

smooth-scrollbar generates a scrollable div <div class="scroll-content" style="transform: translate3d(0px, -1693px, 0px);">...

I'm trying to get waypoints working with this, is it possible or do i need to use native scrolling:?

var inview = new Waypoint.Inview({
            element: $('.js-story-slides')[0],
            enter: function(direction) {
                notify('Enter triggered with direction ' + direction);
            },
            entered: function(direction) {
                notify('Entered triggered with direction ' + direction);
            },
            exit: function(direction) {
                notify('Exit triggered with direction ' + direction);
            },
            exited: function(direction) {
                notify('Exited triggered with direction ' + direction);
            }
            },
            {
                //context: $(".scroll-content")
                offset: function() {
                    return this.element.offsetHeight / -3;
                },
                context: $(".scroll-content")[0]
            });

Source: imakewebthings/waypoints