Shopify themes, liquid, logos, and UX
Hey there,
Website is: www.renssnce.com
On the home page as you can see the header is translucent. But once you start scrolling down it stays that white and is hard to see. How can I make it so that once a user scrolls past some number of pixels or past a section, it turns to black? So that its easy to read.
Thank you ❤️
Solved! Go to the solution
This is an accepted solution.
Hey @renssnce
Follow these Steps:
1) Go to Online Store
2) Edit Code
3) Find theme.liquid file
4) Add the following code in the bottom of the file above </body> tag
<script>
window.addEventListener("scroll", function() {
const header = document.querySelector(".header-wrapper");
if (window.scrollY > 150) {
header.classList.add("scrolled");
} else {
header.classList.remove("scrolled");
}
});
</script>
<style>
.header-wrapper.scrolled {
background: black !important;
}
</style>
RESULT:
If I managed to help you then, don't forget to Like it and Mark it as Solution!
Best Regards,
Moeed
This is an accepted solution.
Hey @renssnce
Follow these Steps:
1) Go to Online Store
2) Edit Code
3) Find theme.liquid file
4) Add the following code in the bottom of the file above </body> tag
<script>
window.addEventListener("scroll", function() {
const header = document.querySelector(".header-wrapper");
if (window.scrollY > 150) {
header.classList.add("scrolled");
} else {
header.classList.remove("scrolled");
}
});
</script>
<style>
.header-wrapper.scrolled {
background: black !important;
}
</style>
RESULT:
If I managed to help you then, don't forget to Like it and Mark it as Solution!
Best Regards,
Moeed
Thank you sir I greatly appreciate it, have a good rest of your day
Hi @renssnce ,
Follow these Steps:
1) Go to Online Store
2) Edit Code
3) Find theme.liquid file
4) Add the following code in the bottom of the file above </body> tag
<script>
window.addEventListener("scroll", function() {
const header = document.querySelector(".header-wrapper");
if (window.scrollY > 150) {
header.classList.add("scrolled");
} else {
header.classList.remove("scrolled");
}
});
</script>
<style>
.header-wrapper.scrolled {
background: black !important;
}
</style>
Got it! If you found my suggestions helpful, please consider liking or marking it as a solution.
Your feedback is appreciated! If you have any more questions or need further assistance, just let me know.
Thanks & Regards
Akshay Bhatt
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024