Replies: 2 comments 11 replies
-
Thank you! And your page is impressive (and smooth on my mac, for what it's worth). I would recommend using a scroll event listener instead of |
Beta Was this translation helpful? Give feedback.
-
A bit of a progress update: I went ahead and re-approached this by using @elalish 's suggestion of a scroll event listener as opposed to requestAnimationframe. While this didn't solve the issue on its own, I then added a play/pause feature so the animation pauses the second the scrolling is deactivated and this got me one step closer. https://zpnew.webflow.io/test-3 playpause-update.mp4While the easing of the scroll when using trackpad feels very messy/jittery still as it slows to a stop (vid attached above), the animation successfully pauses (without jitter!) when the scrolling stops. While this is not a solution, I figured it may shed some light on the underlying issue! code for reference:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone! I've been using Modelviewer for over a year now and have actually learned most of my basic coding knowledge from trying to create web experiences with it (big thanks to the modelviewer team for creating such a clean and open-ended library).
I'm running into an odd bug that I SWEAR wasn't there a few months ago? Or maybe my drivers changed?
The animation loads in fine, and is verrrrry smooth and responsive to the scroll-y position, however, I notice on my 3070gpu and a friend of mines macbook that it becomes very jittery when the user stops scrolling. This doesn't occur on my integrated graphics though. Its almost as if it's between a few frames trying to figure out which ones right. I tried this on a blank page with no other code/elements to ensure it wasn't the page affecting the scroll.
livesite: https://zpnew.webflow.io/
entire code:
<script> function zpennachi() { const modelViewer = document.querySelector('#zpennachi'); const screenHeight = window.innerHeight; modelViewer.currentTime = window.scrollY / screenHeight; window.requestAnimationFrame(zpennachi); modelViewer.timeScale = 0.9; } function StartScroll() { window.requestAnimationFrame(zpennachi); } </script>Any insights into this would be appreciated! As I said, i'm very much in the learning stage of javascript and I may not approaching the scroll event right.
Beta Was this translation helpful? Give feedback.
All reactions