Jump to content

Disable Video on Mobile

Recommended Posts

Hi there,

I am trying to disable the background videos on mobile devices for this page: https://www.katiegrubb.com/create-meditate and have the mobile fallback image display instead. The current background vid cuts off on the edges on mobile and looks bad. 

I have read through other posts and tried to put in CSS code, but none of them seem to work.  I must be doing something wrong. 

Here is a screen shot of how it is looking on the mobile device. 

image.png.0e56c86857bfe7000f43c9a99e87cf4c.png

Can someone please help me?   Thank you 

Link to comment
  • Replies 3
  • Views 317
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

@Mandarin Hi! You can add this code under Website > Pages > Website Tools > Custom CSS

@media screen and (max-width:767px) {
    section[data-section-id="66cd89156fbd1856eda7742c"] .sqs-video-background-native__video-player.video-player {
        display: none !important;
    }
    section[data-section-id="66cd89156fbd1856eda7742c"] .sqs-video-background-native__fallback-image--hidden {
        opacity: 1 !important;
    }
}

 

If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. 

Sam
Web Developer & Digital Designer

 Did you find my contribution helpful? Buy me a coffee?

Link to comment

Hi Lesum. Thank you sooooo much. It worked! What is the key to the code? There is another video on that page that I want to do the same thing for.  I tried to look up the Id of the element, and put a different ID into the code, but it didn't work. So maybe I got the ID wrong, or have to tweak the code a bit. I am going to show you a screen shot of the pic and the code I tried to use. 

IF you have time to help me again, I would appreciate it so much. 
page link: https://www.katiegrubb.com/create-meditate

@media screen and (max-width:767px) {
    section[data-section-id="66cfc0d7cf6610796c911fba"] .sqs-video-background-native__video-player.video-player {
        display: none !important;
    }
    section[data-section-id="66cfc0d7cf6610796c911fba"] .sqs-video-background-native__fallback-image--hidden {
        opacity: 1 !important;
    }
}

 

Screenshot 2024-08-30 at 9.45.14 am.png

Link to comment

@Mandarin Hi! It looks like the wrong section ID was used. The code only hides the background video and displays the fallback image, which is hidden by default. Here’s the code with the correct section ID.

@media screen and (max-width:767px) {
    section[data-section-id="66cfc0d6cf6610796c911fa8"] .sqs-video-background-native__video-player.video-player {
        display: none !important;
    }
    section[data-section-id="66cfc0d6cf6610796c911fa8"] .sqs-video-background-native__fallback-image--hidden {
        opacity: 1 !important;
    }
}

 

If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. 

Sam
Web Developer & Digital Designer

 Did you find my contribution helpful? Buy me a coffee?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.