BearVsShark Posted December 9, 2020 Share Posted December 9, 2020 Site URL: https://oval-denim-r8bs.squarespace.com We added some Parallax functionality and unfortunately it broke the fallback image that comes up for mobile users. Anyone know any way to alter this code to not impact the video header? <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://cdn.jsdelivr.net/parallax.js/1.4.2/parallax.min.js"></script> <script> $('.has-background:not(:has(.sqs-video-background))').each(function() { var findImage = $(this).find('.section-background img'); var imgUrl = findImage.data('src') + '?format=2500w'; var dimensions = findImage.data('image-dimensions'); var imgWidth = dimensions.substr(0, dimensions.indexOf('x')); var imgHeight = dimensions.substr(dimensions.indexOf('x') + 1); $(this).parallax({ bleed: 0, imageSrc: imgUrl, naturalWidth: imgWidth, naturalHeight: imgHeight, speed: .5, }) }); document.getElementsByTagName("body")[0].onresize = function() { setTimeout(function() { jQuery(window).trigger('resize').trigger('scroll') }, 100) }; </script> <style>.has-background{background-color:transparent!important}.has-background .section-background{background-color:transparent!important}.has-background .section-background img{visibility:hidden!important}.has-background.background-width--inset{margin:4vw;padding:0!important}.has-background.background-width--inset:not(.content-collection):not(.gallery-section) .section-background{top:0!important;right:0!important;bottom:0!important;left:0!important}</style> Link to comment
tuanphan Posted December 11, 2020 Share Posted December 11, 2020 Hi. Do you still need help with this? 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
BearVsShark Posted December 18, 2020 Author Share Posted December 18, 2020 On 12/11/2020 at 5:18 PM, tuanphan said: Hi. Do you still need help with this? If possible! Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.