thad Posted August 20, 2020 Share Posted August 20, 2020 Hi all. Just recently I have created a site that runs GSAP tweens with intersection observer. There are quite few different animations going on. While I was developing site, scrollTrigger got released, and I imported scrollTrigger to test it, and I left it in project because of Scrub animations which are very nice, but everything else is powered by intersection observer. I was wondering if it was worth it performance wise, to convert everything to scrollTrigger, especially now that scrollTrigger is included it project anyway? Link to comment Share on other sites More sharing options...
OSUblake Posted August 20, 2020 Share Posted August 20, 2020 Why change something if it's not broken? I doubt you are going to see a performance difference either way. 3 Link to comment Share on other sites More sharing options...
ZachSaucier Posted August 20, 2020 Share Posted August 20, 2020 Intersection observers aren't intrinsically bad. In fact there are some rare cases where it makes more sense to have ScrollTriggers + intersection observers than only ScrollTriggers. ScrollTrigger just allows you to do more things than intersections observers, and especially do it more intuitively (I think). 1 Link to comment Share on other sites More sharing options...
thad Posted August 20, 2020 Author Share Posted August 20, 2020 45 minutes ago, OSUblake said: Why change something if it's not broken? I doubt you are going to see a performance difference either way. That's why I'm asking Thanks 1 Link to comment Share on other sites More sharing options...
thad Posted August 20, 2020 Author Share Posted August 20, 2020 3 minutes ago, ZachSaucier said: rare cases where it makes more sense to have ScrollTriggers + intersection observers I see. Please let me know if you have any example of those rare cases, would love to see them Think I will just leave it as is. Was just wondering since I'm already using scrollTrigger for scrub animation. Thanks for comment Link to comment Share on other sites More sharing options...
ZachSaucier Posted August 20, 2020 Share Posted August 20, 2020 51 minutes ago, thad said: Please let me know if you have any example of those rare cases, would love to see them Needing to know when an element that is within a pinned element goes in and out of the viewport might be one case: Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now