Jump to content
Search Community

background-attachment fixed on mobile devices

dagda1 test
Moderator Tag

Go to solution Solved by Rodrigo,

Recommended Posts

You need to view the codepen result on an actual mobile device.  It looks fine in the chrome dev tools mobile emulator.  I've attached a screenshot.

The codepen use background-attachment: fixed; for the background images, which works fine on desktop devices but not mobile.

Is anyone aware of any fix for mobile or alternative?

99934.png

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

Link to comment
Share on other sites

  • Solution

Hi,

 

This seems to be related to iOS devices as this is working fine on an Android phone:

https://css-tricks.com/the-fixed-background-attachment-hack/

 

Here is another alternative:

See the Pen VaYeoW by callumfindlay (@callumfindlay) on CodePen

 

You can tween the clip path property of the elements using GSAP if you want.

 

Hopefully this helps.

Happy Tweening!

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