Skip to content

Scroll to Waypoint? #610

@tacman

Description

@tacman

Thanks, Caleb, for putting this library together, it's really great.

How can I programmatically scroll to a waypoint? I'm highlighting the text in the middle of the screen

$('.waypoint').each(function(index, element) {
    const waypoint = new Waypoint({
        element: element,
        offset: '50%', 
        handler: (e) => {
            let $el = $(this);
            let text = $el.first();
            $('.expand').removeClass('expand');

            // get the text span (dialogue) element
            let $dialogElement = $el.find('.dialogue-text').addClass('expand');
        });
});

I've been trying to use the jquery-scrollto plugin, but running into issues with webpack, so figured I'd ask here just in case there's an easy way to do it. You've obviously done a lot of work with the scrolling and positioning events.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions