jambamoose
-
Posts
5 -
Joined
-
Last visited
Content Type
Forums
Gallery
Blogs
Events
Store
Downloads
Profiles
Posts posted by jambamoose
-
-
On 9/22/2020 at 1:27 PM, rwp said:
@jambamoose give this a shot
var topIMG = $(".header-title-logo img").attr("src"); var sclIMG = ""; $(window).scroll(function() { var value = $(this).scrollTop(); if (value > 50) $(".header-title-logo img").attr("src", sclIMG); else $(".header-title-logo img").attr("src", topIMG); });
@rwp I inserted that into my header code, and then inserted the URLs for the two image uploads in the spots you have marked in quotes, but it doesn't seem to be working. Guessing I'm doing something wrong...Feel free to check my code.
-
@tuanphan Just checking in on this in case this got buried..
-
@tuanphan Yes, please! I'm trying to change it to a different logo on the header when scrolling in 7.1.
-
Trying to figure out this same issue @rwp -- Followed all of the steps, isntalled JQ in the header injection, uploaded the two logos, inserted them into your above code in the header injection, and no dice! Appreciate your help.
Website: https://copper-mustard-c87b.squarespace.com/
PW: HBA2020
Change logo on scroll with fixed header 7.1
in Customize with code
Posted
@tuanphan Thanks for the reply...Here's my code, still having some trouble..
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
var topIMG = $(".header-title-logo img").attr("src");
var sclIMG = "https://static1.squarespace.com/static/5f2adc20b7290058dd53441e/t/5f5e7c1988ce6e3f57804e53/1600027673615/HBA-Logo-Website.png";
$(window).scroll(function() {
var value = $(https://static1.squarespace.com/static/5f2adc20b7290058dd53441e/t/5f5e7c1988ce6e3f57804e53/1600027673615/HBA-Logo-Website.png).scrollTop();
if (value > 50)
$("https://static1.squarespace.com/static/5f2adc20b7290058dd53441e/t/5f5e7c1988ce6e3f57804e53/1600027673615/HBA-Logo-Website.png").attr("src", sclIMG);
else
$(".header-title-logo img").attr("src", topIMG);
});
</script>