Jump to content
Search Community

iOS issue: background-size:cover/parallax not responsive

GBrachetta test
Moderator Tag

Recommended Posts

I have 4 divs stacked each with an img background covering the viewport, and a parallax with GSAP and ScrollTrigger that moves the images at a different speed than the scrolling as I scroll down.

This works fine on all devices except iOS: after deployment, while it still works perfectly on desktop and Android, the images don't scale down on iPhone so I see a clipped portion of my images, zoomed in.

I'm aware there's an issue with background-size:cover and background-attachment:fixed on iOS, but I really would love to find a way to give iOS users the right experience.

I tried using background-attachment:scroll and the images look fine in that case, but then my parallax doesn't work well as it creates a gap between each div as I scroll down.

Is there a way to fix this for iOS?

See the Pen JjKpejW by gbrachetta (@gbrachetta) on CodePen

Link to comment
Share on other sites

Hey GBrachetta and welcome to the GreenSock forums.

 

This is an iOS issue and not a GSAP one. As such we don't really have the capacity to try and figure out a workaround for the issue that you're facing. It's possible that someone might investigate and find a solution though.

 

With that being said you could avoid the issue entirely by using actual <img> elements instead of using background images.

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...