Slidebars icon indicating copy to clipboard operation
Slidebars copied to clipboard

jQuery Waypoints

Open tomislavboric opened this issue 9 years ago • 3 comments

Hi, just figured out, after few hours of troubleshooting - that Waypoints don't work when I use Slidebars page layout. Problem is that Waypoints can't trigger elements while scrolling. As soon as I removed div's that belongs to Slidebars it worked!

Is there some quick fix for that? Maybe some overflow..somewhere?

Thanks so much for any help

tomislavboric avatar Oct 04 '16 02:10 tomislavboric

+1 thanks

apuntovanini avatar Oct 11 '16 13:10 apuntovanini

Might be a CSS issue related to these topics:

https://github.com/adchsm/Slidebars/issues/251 https://github.com/adchsm/Slidebars/pull/257

JoryHogeveen avatar Oct 14 '16 23:10 JoryHogeveen

I believe this is due to the container setup Slidebar uses. Basically when scrolling the page you are not scrolling the body anymore, you are scrolling the canvas container. Due to this, waypoints and other plugins that target the body will stop working.

To get waypoints to work, you need to use 'context' (http://imakewebthings.com/waypoints/api/context-option/) to target the new container. I added the ID canvas to the canvas container and waypoints now works as it should.

var waypoint = new Waypoint({ element: document.getElementById('about'), handler: function() { console.log("reached!"); }, context: document.getElementById('canvas') });

guyhamilton avatar Nov 16 '16 21:11 guyhamilton