Site logo

Archived topic

Fixed background container images

9 replies · Started by David on June 20, 2022

Viewing posts 1–10 of 10

Hello

I'm currently taking a squarespace website and putting it into wordpress using generatepress and generateblocks.

On this page...
https://shalayogahaven.co.uk/community

They have some fixed background images, I've recreated this here...
http://shalayogahaven-co-uk.stackstaging.com/community/

It works fine on my desktop computer, but the images look awful on ipad, however the original squarespace site background images work fine on the ipad - how can I reproduce this effect?

Thanks
Dave

Hi there,

it looks like that site uses a Javascript parallax script, which we don't have a built in solution for on GB.

GB uses the background-attachment: fixed property.
Most mobile/tablet devices disable it, due to the high processing overhead ( battery consumption ).
And iOS has a known bug where it scales up the image. To stop that from happening, see my reply here:

https://generatepress.com/forums/topic/no-headerpicture-on-ipad-129/#post-2237727

Thanks David - shame it can't parallax on ipad, but it looks much better after adding the css you provided.

You're welcome

It looks ok to me, have you tried clearing any browser caches ?

Doh ... looking at the wrong page.

Change the CSS to:

@media (pointer: coarse) {
    .gb-container,
    .gb-container:before {
        background-attachment: initial !important;
    }
}

That will cover both types of background image

Thanks David, that did the trick :)

Glad to hear that!

This archived topic is closed to new replies.