exitmult Posted September 27, 2023 Posted September 27, 2023 (edited) My site has a Youtube video that plays in the background. When I first designed and tested it several months ago, the fallback image displayed on mobile devices. I just discovered that now the video is playing on mobile devices. The video will not work on a mobile device as it looks terrible. After looking over the forums and redit, I was able to get the background video to stop displaying but I can't get the fall-back image to display. I am currently using the code below to disable the video on mobile. I got it from a 2021 forum thread (pasted at the bottom) but can't figure out how to properly implement the background image. I can't figure out how to find the URL of my fallback image. Thanks in advance for the help. @media only screen and ( max-width : 640px ) { [data-section-id="64f8d91696c6033781491d62"] .section-background { & > * { display : none; } background-image : fallback-image; } } Edited September 27, 2023 by exitmult
KwameAndCo Posted September 27, 2023 Posted September 27, 2023 Link to the site please? exitmult 1 Work With Me 🖥️💻📱 Please remember to tag me so that I get a notification and respond to your help requests. If my answers have helped you, please drop a like and mark my answer as best to help other users find solutions quickly. You can also thank me or make requests by buying me a coffee ☕. (Caffeine fuels me to take more requests) For Squarespace Tips & Tricks, visit @squareskills (Youtube 📺 Tutorials) For Premium and FREE plugins, visit Squareskills (Plugin Store) 🧩 For Custom Plugins email me 🧩
exitmult Posted September 29, 2023 Author Posted September 29, 2023 (edited) https://www.skilledtradesmedia.com/ Also, I don't know how to tag people in this forum. I'm brand new. Thanks! Edited September 29, 2023 by exitmult
tuanphan Posted October 3, 2023 Posted October 3, 2023 On 9/30/2023 at 12:44 AM, exitmult said: https://www.skilledtradesmedia.com/ Also, I don't know how to tag people in this forum. I'm brand new. Thanks! Use this CSS code to disable mobile + show image @media screen and (max-width:767px) { [data-section-id="64f8d91696c6033781491d62"] .section-background>* { display: block !important; } [data-section-id="64f8d91696c6033781491d62"] .section-background img { left: 0 !important; } [data-section-id="64f8d91696c6033781491d62"] .section-background video { visibility: hidden !important; } } Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
exitmult Posted October 3, 2023 Author Posted October 3, 2023 Tuanphan, thanks for replying. I tried the code you provided and I can't get it to work. I experimented around with it and no matter what I tried the video still loads in the background for mobile sites. The only way I can block the video is using: @media screen and (max-width:767px) { [data-section-id="64f8d91696c6033781491d62"] .section-background { display : none; } } But when I do that and try and use the ".section-background img" command you provided to force the background image to show, I just get a grey background. I tried using the 2 lines of code you provided to block and hide the video, see below, both alone and together. No matter what I tried they don't block the background video from showing. @media screen and (max-width:767px) { [data-section-id="64f8d91696c6033781491d62"] .section-background>* { display: block !important; } [data-section-id="64f8d91696c6033781491d62"] .section-background video { visibility: hidden !important; } } At this point I have no idea what to do. Thanks again for the help.
tuanphan Posted October 6, 2023 Posted October 6, 2023 On 10/3/2023 at 9:42 PM, exitmult said: Tuanphan, thanks for replying. I tried the code you provided and I can't get it to work. I experimented around with it and no matter what I tried the video still loads in the background for mobile sites. The only way I can block the video is using: @media screen and (max-width:767px) { [data-section-id="64f8d91696c6033781491d62"] .section-background { display : none; } } But when I do that and try and use the ".section-background img" command you provided to force the background image to show, I just get a grey background. I tried using the 2 lines of code you provided to block and hide the video, see below, both alone and together. No matter what I tried they don't block the background video from showing. @media screen and (max-width:767px) { [data-section-id="64f8d91696c6033781491d62"] .section-background>* { display: block !important; } [data-section-id="64f8d91696c6033781491d62"] .section-background video { visibility: hidden !important; } } At this point I have no idea what to do. Thanks again for the help. Can you add & keep my code in CSS box? I can check it again easier Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
Solution exitmult Posted October 11, 2023 Author Solution Posted October 11, 2023 I did some more Googling today and found an older thread that fixed my problem. Paul2009's response fixed my issue right up. paul2009 and tuanphan 1 1
KatrinaCart Posted November 8 Posted November 8 Hi, I’ve tried these codes and still can’t get the mobile fall back image to load on my landing page/homepage. All that appears is the landscape video for desktop. Not the custom portrait gif I loaded into the mobile fallback content box. any idea what I’m doing wrong? website is k-tess.com thanks
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment