CaminoQuest Posted August 25 Posted August 25 (edited) Hi, I'm trying to add CSS code to create fixed background images that are revealed (like looking through a window) as a visitor scrolls down. Here is an example of what I'm trying to reproduce on my site: https://wggcharliedawn.showit.site/. The only thing I've been able to sort of do so far is make certain sections sticky and others aren't. This is close to the desired effect but the image scrolls -- instead of just appearing -- and sticks to the top until the next scrolling section covers it. Thanks. Edited August 25 by CaminoQuest
tuanphan Posted August 28 Posted August 28 I think you can use CSS background-attachment: fixed with image to do this. If you share link to page, we can check 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!)
CaminoQuest Posted August 28 Author Posted August 28 Hey Tuanphan, thanks for your response. go to https://caminoquestpreview.squarespace.com/ PW: DEMO. Scroll down to 2025 Pilgrimages (scrolling marquee) and you'll see May 11-17 pilgrimage. Click on Explore this Route button and it will take you to the page in question. Once here you'll see I have 3 sticky sections that I would love to change to fixed image. Thanks!
Solution tuanphan Posted September 1 Solution Posted September 1 On 8/29/2024 at 12:46 AM, CaminoQuest said: Hey Tuanphan, thanks for your response. go to https://caminoquestpreview.squarespace.com/ PW: DEMO. Scroll down to 2025 Pilgrimages (scrolling marquee) and you'll see May 11-17 pilgrimage. Click on Explore this Route button and it will take you to the page in question. Once here you'll see I have 3 sticky sections that I would love to change to fixed image. Thanks! Try this code for Galician section section[data-section-id="66cb5c8d3d670b2996b9870b"] { & { position: relative !important; } img { visibility: hidden; } .section-border { background-image: url(https://images.squarespace-cdn.com/content/v1/66ba2c75e4355a5823e54ffe/54d78f8a-b0fd-4d70-9557-9478bc8ec0ae/Galicia+Horreos.png?format=2500w); background-size: cover; background-color: transparent !important; background-attachment: fixed; } .section-background, section { background-color: transparent !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!)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment