Jump to content
Search Community

mobile problem safari - paralax effect image jumps when adress bar hides

bujutsu1 test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

Hey community!

I made a really simple parallax effect with Scrolltrigger using scrub.

 

On desktop it works fine but on mobile - Safari - the image jumps when the Adress bar hides/comes back into view.

I also can see the markers jump.

 

here is my code:

 

gsap.fromTo(
imageRef.current,
{
yPercent: -20,
autoAlpha: 1,
},
{
yPercent: 20,
ease: "none",
autoAlpha: 1,
 
scrollTrigger: {
trigger: imageRef.current,
scrub: true,
markers: true,
},
}
);

 

 

any hints on how to fix this?

 

 

thank you already!

 

have a great weekend!

 

 

Link to comment
Share on other sites

  • 1 month later...

for those those need to fix this in the future and are using scrollsmoother,i fixed the same issue by setting the code as follows:

now the mobile browser don't refresh if scrolldown(default native behavior)

and the jumpy address bar is fixed at all times(don't show/hide)anymore

its buttery smooth.

 
// in the css
#smooth-content {
  position: absolute;
  display: grid;
  overflow: visible;
  min-height: 100vh;
}
// and in the javascript BEFORE SETUP THE SCROLLTRIGGER
ScrollTrigger.normalizeScroll(true) // enable
 ScrollTrigger.config({
    limitCallbacks: true,
    ignoreMobileResize: true,
 })
  • Thanks 2
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...