Skip to content
This repository was archived by the owner on Jan 24, 2018. It is now read-only.
This repository was archived by the owner on Jan 24, 2018. It is now read-only.

handleLink() - How to get actual scrolling direction? #58

@agualbbus

Description

@agualbbus

I'm using skrollr-menu like this:

<a href="#slide4" data-menu-top="250p"></a>

I'm using the skrollr keyframe option to high light the menu items when reaching the desired position, but the events are not fired when skrollr-menu reaches the data-menu-top scrolling value.
In order to get the event fired I need to +1p when scrolling down and -1p when up.

So I came up with this possible solution:

<a href="#slide4" data-menu-top="250"></a>

    handleLink: function(link) {
        var t=parseInt(link.getAttribute('data-menu-top'));

        if(scrolling=='down'){
            t = String(t+1)+'p';
        }
        else{
            t = String(t-1)+'p';
        }   
        //console.log(t);

        return t;
    },

But I dont' t know how to get the scrolling direction....
Can you help me please?

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