How do I prevent the background image from loading on the mobile site?

Posted in: Newsmag
Post count: 32

So basically, the background image can barely been seen on the mobile site, and it’s unnecessarily slowing the website down. How can I set it up in a way that it doesn’t load on the mobile site but still works on the desktop site?

Post count: 23312

Hello lifemathmoney,

If you want to hide the background-image to your mobile devices you should use the code below and place it in Theme panel -> Custom CSS Area.

The code is ->

@media (max-width:767px){
.backstretch{
display:none;
}
}

Thanks.

Post count: 32

Unfortunately, that only hides the background, not prevent it from loading in the first place.

I want to save on the website resources, so I don’t want the background to load on the mobile site.

Please help, thanks.

Post count: 20688

Hi,

First you would have to detect that a mobile is used, then to create a condition for the background to not load in those circumstances. The background is loaded here
https://www.screencast.com/t/H7qG8sdoDY
I never tried something like that unfortunately so exactly how this would be possible I don’t know exactly.

Thanks

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newsmag’ is closed to new topics and replies.