I’ve got a scroll path event occurring when I reach this point in the site’s destination. As you can see from the following code, when a user travels to this specific point, “my work,” the div “#mywork” fades in, (as it’s css is originally set to display:hidden.)
path.lineTo( 3220, 4600,{
callback: function() {
$("#mywork").fadeIn(2000, "linear");}, name: "mywork"});
I would like the “#mywork” div to fade out whenever the user leaves this point (i.e. scrolls away from it, and/or clicks on a different navigation link.) If the user returns, I would like for the div to fade back into view as it normally would.
Any suggestions? Thanks so much in advance if you can find the time to help me.
I think this library can help you out. You’d use it in place of path.lineTo.
https://github.com/sakabako/scrollMonitor