Notice I pulled your custom code out of the smoothScroll() function. The fundamental problem was that the scrollerProxy's setter needed to ALSO set the actual scroll position of the page (not just the "fake" content scroll) so that they're synchronized, but doing so directly would create a funky loop because the main ScrollTrigger is set up to basically smooth out the "real" scroll position, thus when we set it in the scrollerProxy(), it was being softened in a sense. I updated the smoothScroll() function to sense that condition and work around it. Seems to work well, right?Īnd yes, the snapping logic already employs the technique you mentioned internally where it checks to see if the scroll position matches (or is at least very close to.because browsers are weird) the last one set by the snap tween. If not, it kills it, assuming the user (or something else) influenced the scroll.Īnyway, it feels good to have that one figured out. Hopefully the new function solves any issues you were running into. Please let me know if it works well for you.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |