flickering, jumping when using setPin()
See original GitHub issueI am using this following code to make a scale-based Animation with ScrollMagic and GSAP:
const timeline = gsap.timeline({ paused: true });
timeline.fromTo(Container, 1, { scale: 2.5 }, { scale: 1 });
const containerResizeScene = new ScrollScene({
triggerElement: document.querySelector('#hero'),
triggerHook: 0,
duration: 500,
gsap: {
timeline: timeline
}
});
containerResizeScene.Scene.setPin('#subheading'); //set Pin
but when I scroll, the scalable element always jumps up briefly. I have already tested several css properties, but nothing worked really well, except I use position: absolute
and I remove the setPin()
function.
I have read that a native setPin()
function is planned… Could this be my solution? Can I wait for the implementation, or do I have to think of an alternative?
Are there any helpful tips or workarounds?
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Fix screen flickering in Windows - Microsoft Support
Screen flickering in Windows is usually caused by display drivers. To update your display driver, you'll need to start your PC in safe...
Read more >Circuit1
You can make use of the millis() function to keep track of the time when ... long debounceDelay = 50; // the debounce...
Read more >Networking and Communications - Fab Academy
Once this is done, just import all you component for your board using the "add" ... if (flashing ) { if (mySerial.available() >...
Read more >attachInterrupt: Flow meters trigger button interrupt - Firmware ...
Using an electron, Device OS: 1.5.0, flashing with Workbench. Serial connected. Using two flow meters, two push buttons, and a motorized valve, ...
Read more >First Steps With The Arduino: A Closer Look At The Circuit ...
That line is saying "Set pin 13 to output mode". 13, remember, is the built-in LED. Then there is the loop: void loop()...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@niklasgrewe I added a “mimic pinning” example. It basically simulates a pin in the hero. https://scrollscene.jonkwheeler.now.sh/?path=/story/scrollscene-examples--mimic-pinning
You can see the code here: https://github.com/jonkwheeler/ScrollScene/blob/master/src/stories/story.js#L1464
Again though, if you want to learn how to use this more, please take Petr’s course https://ihatetomatoes.net/get-scrollmagic-workshop/ as it shows you how to do all of this.
@jonkwheeler thank you very much for this example. You don’t know how much you’ve helped me. Now the animation works as desired, no flickering or jumping - thanks for your effort
But I still have only one small questions and I hope that you can answer them:
How can i calculate the scale number correctly?
I do not want to scale the box with static values and mediaQueries. Would you know a sample formula that can calculate how much I need to scale the box on each screen? Currently I scale with
2.2
and useheight: 100vh
on the figure tag. The problem is that, depending on the scaling value, I also have to change the height so that the screen-image is displayed centered. How could I make the whole thing more dynamic? Do you have an idea?I’m not asking you any more questions on this issue. But I would be very grateful if you could give me some assistance in these one point. Thanks again for your generous support. 🎉