janpaepke / ScrollMagic

The javascript library for magical scroll interactions.
http://ScrollMagic.io
Other
14.89k stars 2.17k forks source link

How to trigger a scene based on ending of previous? (problem on mobiles) #940

Open artemdzyuba opened 4 years ago

artemdzyuba commented 4 years ago

Hello I have to execute scenes not only on a trigger, but also on ending of previouse scene. Moreover, I want to exectue scene after some scrolling from a previouse trigger.

Now I use offset: var scene = new ScrollMagic.Scene({ triggerElement: "#some_element", duration: "100%", offset: window.innerHeight*2 })

but this works badly on mobile devices, because I ask the user to turn horizontally and innerHeight seems not to update. On horizontal orientations from the begining (desktop, horizontal mobiles) works well.

What's the best universal solution?

artemdzyuba commented 4 years ago

For now I use reload page, but this is a way clunky solution window.onorientationchange = function() { window.location.reload(); }