Jump to content
Search Community

scroll trigger only updates after scroll end in chrome

marley test
Moderator Tag

Recommended Posts

i have a nuxt.js website that i am building and i am using GSAP for scroll animations which work fine in safari and firefox however in chrome the animations only update after the scroll has ended.
 

<template>
<div class="our-approach__section" :key="index" ref="ourApproach__section">
<div class="our-approach__content">
<div class='our-approach__icon'>
<CircleIcon />
 
<svg ref="svgRotate" class="svgRotate" :style="{ transform: 'rotate('+ rotateMe+'turn)'}" xmlns="http://www.w3.org/2000/svg" width="209" height="209" viewBox="0 0 209 209" fill="none">
<circle cx="104.5" cy="104.5" r="102.5" :stroke="this.sectionData.colour" stroke-width="4" stroke-miterlimit="1" stroke-linecap="round" stroke-dasharray="3 19"/>
</svg>
 
</div>
<div class="content">
<h3 :style="{ color: this.sectionData.colour }">{{ this.sectionData.title }}</h3>
{{ this.sectionData.content }}
</div>
</div>
<div class="our-approach__line-container">
<div class="line" :style="{ background: 'linear-gradient(90deg, ' + this.sectionData.colour + ' 0%, ' + this.secondColour + ' 100%)' }">
<div :style="{ backgroundImage: 'url(/images/Line.png)'}"> </div>
</div>
</div>
</div>
</template>
 
<script>
 
import gsap from "gsap"
 
export default {
name: 'OurApproachSection',
props: {
sectionData: Object,
secondColour: String
},
data(){
return {
rotateMe: 1,
turn: 0.5,
scrollMe: null,
svgItem: null,
svgContainer: null,
}
},
mounted(){
this.svgItem = this.$refs.svgRotate
this.svgContainer = this.$refs.ourApproach__section
 
gsap.to(this.svgItem, {
scrollTrigger: {
trigger: this.svgContainer,
markers: true,
scrub: 0.5
},
rotation: 360,
autoAlpha: 1,
ease: 'none',
})
 
},
}
</script>

 

Link to comment
Share on other sites

It's pretty tough to troubleshoot without a minimal demo - the issue could be caused by CSS, markup, a third party library, your browser, an external script that's totally unrelated to GSAP, etc. Would you please provide a very simple CodePen or CodeSandbox that demonstrates the issue? 

 

Please don't include your whole project. Just some colored <div> elements and the GSAP code is best (avoid frameworks if possible). See if you can recreate the issue with as few dependancies as possible. If not, incrementally add code bit by bit until it breaks. Usually people solve their own issues during this process! If not, then at least we have a reduced test case which greatly increases your chances of getting a relevant answer.

 

Here's a starter CodePen that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo

See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen

 

If you're using something like React/Next/Nuxt/Gatsby or some other framework, you may find CodeSandbox easier to use. 

 

Once we see an isolated demo, we'll do our best to jump in and help with your GSAP-specific questions. 

Link to comment
Share on other sites

update: 

the issue seemed to be caused by chrome throttling the sites rendering as i had a lot of large SVGs in a draggable background, i removed the SVGs and the issue is gone. 

what i thought was interesting was if i went to the site after viewing figma everything would run smoothly with all the SVGs until i scroll wildly causing what looked like frame lag and then everything would be broken again.I would then be able to open figma and go back to my site and everything would run smoothly again.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...