Gerrit Posted January 6, 2021 Share Posted January 6, 2021 Site URL: https://www.a1-berlin-de.com/ Hi to all, I'm trying to minimize the A1-logo on my website when scrolling down and found a suggestion in the forum, but it doesn't work in my case. If I add in the jQuery script I get the information "Syntax Error on line 1" (see attachment). Could you perhaps helb me? The website ist https://www.a1-berlin-de.com/ and the password is "TEST". If you can help me it would be great if you could give me a complete code. The second thing is the grey background behind the header. Is there perhaps a possibility to make it half transparent (80 %) when scrolling? Thanks in advace! Gerrit This is the code that doesn't work: <script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script> var topIMG = "https://images.squarespace-cdn.com/content/5ef332f7515832774d90c2a4/1609430530526-QSPFV5FZBZ13DOXZGRFY/A1+Logo+w.png?content-type=image%2Fpng"; var sclIMG = "https://images.squarespace-cdn.com/content/5ef332f7515832774d90c2a4/1609430530526-QSPFV5FZBZ13DOXZGRFY/A1+Logo+w.png?content-type=image%2Fpng"; $('img[alt=„A1+Logo+w“]‘).attr("class", "logo") $(window).scroll(function() { var value = $(this).scrollTop(); if (value > 50) $(".logo").attr("src", sclIMG); else $(".logo").attr("src", topIMG); });</script> Link to comment
tuanphan Posted January 7, 2021 Share Posted January 7, 2021 Hi. With JavaScript, you need to insert to Home > Settings > Advanced > Code Injection > Footer 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
Archived
This topic is now archived and is closed to further replies.