You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 24, 2018. It is now read-only.
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.
sarboc thanks for your reply, I couldn't use your snippet because the handleLink function runs before the scrolling event, but it inspire me and I finally I came with this:
<a href="#slide4" data-menu-top="250"></a>(position in percentage value without "p")
handleLink: function(link){vartarget=parseInt(link.getAttribute('data-menu-top')),//percentage position of targetcurrentTop=$(window).scrollTop();currentTop=Math.round(sizes.bodyH())*currentTop/100;//convert to percentage target=(currentTop<target) ? String(target+1)+'p' : String(target-1)+'p';//console.log(target);returntarget;//ex: 251p},
Need to improve yet, sometimes that -+1p gives an undesired offset, but I achived the main goal that was to fire the event that high lights those links.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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>
But I dont' t know how to get the scrolling direction....
Can you help me please?
Thanks!
The text was updated successfully, but these errors were encountered: