Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi all, I am trying to find how to enable transparent and sticky header in the Emerge theme.
Any assistance would be greatly appreciated
Solved! Go to the solution
This is an accepted solution.
Hi, It's done. Could you check if it is ok now?
- Solved it? Hit Like and Accept solution! ❤️Buy Me Coffee❤️
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
Hi @Klaw2OC
Could you share your store URL?
- Solved it? Hit Like and Accept solution! ❤️Buy Me Coffee❤️
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
Hi @Klaw2OC
You can try to add this code to your theme.liquid file after <head> element in Online store > Themes > Edit code, save file and check it it work
<style>
/* Add styles for the sticky header */
#shopify-section-header {
/* Set initial styles */
transition: all 0.3s;
}
#shopify-section-header.header-sticky {
position: fixed;
top: 0;
width: 100%;
z-index: 1000;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", function () {
var headerDiv = document.getElementById("shopify-section-header");
// Function to add or remove the "header-sticky" class based on scroll position
function toggleStickyHeader() {
var scrollPosition = window.scrollY || window.pageYOffset;
if (scrollPosition >= headerDiv.offsetTop) {
headerDiv.classList.add("header-sticky");
} else {
headerDiv.classList.remove("header-sticky");
}
}
// Add scroll event listener to toggle sticky header
window.addEventListener("scroll", toggleStickyHeader);
});
</script>
- Solved it? Hit Like and Accept solution! ❤️Buy Me Coffee❤️
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
It works! However, I would like the header (not transparent this time) to stay under the banner and become sticky only after scrolling through the banner. Is this possible?
Please update the code and check again
<style>
/* Add styles for the sticky header */
#shopify-section-header {
/* Set initial styles */
transition: all 0.8s;
}
#shopify-section-header.header-sticky .header--root {
position: fixed;
top: 0;
width: 100%;
z-index: 1000;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", function () {
var headerDiv = document.getElementById("shopify-section-header");
// Function to add or remove the "header-sticky" class based on scroll position
function toggleStickyHeader() {
var scrollPosition = window.scrollY || window.pageYOffset;
if (scrollPosition >= headerDiv.offsetTop) {
headerDiv.classList.add("header-sticky");
} else {
headerDiv.classList.remove("header-sticky");
}
}
// Add scroll event listener to toggle sticky header
window.addEventListener("scroll", toggleStickyHeader);
});
</script>
- Solved it? Hit Like and Accept solution! ❤️Buy Me Coffee❤️
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
The header shouldn't be transparent any more, even when scrolling down.
Code update
<style>
/* Add styles for the sticky header */
#shopify-section-header {
/* Set initial styles */
transition: all 0.2s;
}
#shopify-section-header.header-sticky .header--root {
position: fixed;
top: 0;
width: 100%;
z-index: 1000;
background: #fff;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", function () {
var headerDiv = document.getElementById("shopify-section-header");
// Function to add or remove the "header-sticky" class based on scroll position
function toggleStickyHeader() {
var scrollPosition = window.scrollY || window.pageYOffset;
if (scrollPosition > headerDiv.offsetTop) {
headerDiv.classList.add("header-sticky");
} else {
headerDiv.classList.remove("header-sticky");
}
}
// Add scroll event listener to toggle sticky header
window.addEventListener("scroll", toggleStickyHeader);
});
</script>
- Solved it? Hit Like and Accept solution! ❤️Buy Me Coffee❤️
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
Is there a way to avoid the header flickering during the transition?
Could you update code to this and check again?
<style>
/* Add styles for the sticky header */
#shopify-section-header {
/* Set initial styles */
transition: all 0.2s;
}
#shopify-section-header.header-sticky .header--root {
position: fixed;
top: 0;
width: 100%;
z-index: 1000;
background: #fff;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", function () {
var headerDiv = document.getElementById("main-content");
// Function to add or remove the "header-sticky" class based on scroll position
function toggleStickyHeader() {
var scrollPosition = window.scrollY || window.pageYOffset;
if (scrollPosition > headerDiv.offsetTop) {
headerDiv.classList.add("header-sticky");
} else {
headerDiv.classList.remove("header-sticky");
}
}
// Add scroll event listener to toggle sticky header
window.addEventListener("scroll", toggleStickyHeader);
});
</script>
- Solved it? Hit Like and Accept solution! ❤️Buy Me Coffee❤️
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
The header is not sticky now.
Could I send a collaborator request access to your store so I can check and help you with this?
- Solved it? Hit Like and Accept solution! ❤️Buy Me Coffee❤️
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
No problem
Give me your Collaborator request code.
- Solved it? Hit Like and Accept solution! ❤️Buy Me Coffee❤️
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
0130
Request sent
- Solved it? Hit Like and Accept solution! ❤️Buy Me Coffee❤️
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
This is an accepted solution.
Hi, It's done. Could you check if it is ok now?
- Solved it? Hit Like and Accept solution! ❤️Buy Me Coffee❤️
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
Exactly the way I want! Thank you
Happy I could help 😁
- Solved it? Hit Like and Accept solution! ❤️Buy Me Coffee❤️
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
Hi, do you have the code for the transparent en sticky header? but it have to be white when scrolling.
Hi. I also need the sticky header fixed for Emerge theme. Can you do?
HI @D7Swim Could you share your store URL?
- Solved it? Hit Like and Accept solution! ❤️Buy Me Coffee❤️
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
Hi @D7Swim
Do you want the header fixed at the top like this?
- Solved it? Hit Like and Accept solution! ❤️Buy Me Coffee❤️
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
Please add this code to Custom CSS in Online Store > Themes > Customize > Theme settings.
.header--root { position: fixed !important; width: 100%; }
- Solved it? Hit Like and Accept solution! ❤️Buy Me Coffee❤️
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey 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, 2024