Archived topic
Fixed background container images
9 replies · Started by David on June 20, 2022
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
Is it just me or is it not working on the first 2 images on the homepage...
http://shalayogahaven-co-uk.stackstaging.com/
It looks ok to me, have you tried clearing any browser caches ?
Yea, loading it in incognito and it still looks like this on the ipad...
https://ibb.co/TcqBXL5
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!