lilpruks Posted August 10, 2023 Share Posted August 10, 2023 (edited) I created a paralax scroll, with this piece of CSS: section[data-section-id="section-id-here"] .section-background { background: url('custom-file-image-here'); background-size: cover; background-position: center; background-attachment: fixed; background-repeat: no-repeat; } works like a charm on a desktop. however, there is no parallax on mobile. the photo on mobile looks awful as it's very zoomed in. does anyone know how to fix this? Edited August 10, 2023 by lilpruks needed to add more tags Link to comment
tuanphan Posted August 11, 2023 Share Posted August 11, 2023 Hi, background-attachment: fixed won't work on iOS. iOS doesn't support this attribute You can consider disable effect on mobile 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!) Link to comment
lilpruks Posted August 11, 2023 Author Share Posted August 11, 2023 (edited) 37 minutes ago, tuanphan said: Hi, background-attachment: fixed won't work on iOS. iOS doesn't support this attribute You can consider disable effect on mobile okay, do you know how I add that to the CSS? and if I disable parallax for mobile, I need to ensure the image appears full size on mobile? Thanks Edited August 11, 2023 by lilpruks Link to comment
tuanphan Posted August 12, 2023 Share Posted August 12, 2023 22 hours ago, lilpruks said: okay, do you know how I add that to the CSS? and if I disable parallax for mobile, I need to ensure the image appears full size on mobile? Thanks Can you share link to page where you use this effect? We can check/give code 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!) Link to comment
lilpruks Posted August 15, 2023 Author Share Posted August 15, 2023 (edited) On 8/12/2023 at 5:26 AM, tuanphan said: Can you share link to page where you use this effect? We can check/give code easier Pineslandscaping.ca password: Pineslandscaping the effect is on multiple pages throughout the site Edited August 15, 2023 by lilpruks Link to comment
Solution tuanphan Posted August 19, 2023 Solution Share Posted August 19, 2023 On 8/10/2023 at 7:48 AM, lilpruks said: I created a paralax scroll, with this piece of CSS: section[data-section-id="section-id-here"] .section-background { background: url('custom-file-image-here'); background-size: cover; background-position: center; background-attachment: fixed; background-repeat: no-repeat; } works like a charm on a desktop. however, there is no parallax on mobile. the photo on mobile looks awful as it's very zoomed in. does anyone know how to fix this? You can change code to this, to force it run on desktop only @media screen and (min-width:992px) { section[data-section-id="section-id-here"] .section-background { background: url('custom-file-image-here'); background-size: cover; background-position: center; background-attachment: fixed; background-repeat: no-repeat; } } 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!) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment