imakewebthings / waypoints

Waypoints is a library that makes it easy to execute a function whenever you scroll to an element.
http://imakewebthings.com/waypoints/
10.38k stars 1.33k forks source link

WAYPOINT JQUERY Mobile: Change page issue with triggering of waypoint #583

Open nyluje opened 6 years ago

nyluje commented 6 years ago

Question linked to that StackOverflow thread

I use JQuery 1.11.1, JQueryMobile 1.4.2 and the JS library Waypoint.

I have trouble that, from what I understood, are linked to JQuery Mobile and positionning of Waypoint-s when switching between pages.

Here is a JSFiddle with an example of the problem (NB: in the JS part I had to copy the code of Waypoint library at the top, scroll to the bottom for the code involving the setting of waypoints on DOM objects; The result window should be >500px and display a scrolling bar to execute the test correctly ).

When you firt load the JSFiddle: you scroll down and it will trigger both Waypoint (2 alert() messages following each other) instead of trigerring only waypoint of page #1.

If you load the JSFiddle, then use sequentially the links: "go to page 2" , "go to page 1", and scroll down the page #1, the Waypoint does not tigger (no alert() message).

If you load the JSFiddle, then use sequencialy the links: "go to page 2" and scroll down the page #2, the Waypoint does not tigger (no alert() message).