All things Shopify and commerce
Hello There ,
Is there any way to close the filter list as default when the website loads.
Site Url :: https://pa0n5prg8hpj4k25-71493648693.shopifypreview.com
Thank You!!!
hi @Anonymous
Its SideNode! We will be happy to help you today.
You can try this code: it will be helpful to you
window.addEventListener("load", function() {
const elements = document.querySelectorAll(".facets__disclosure-vertical");
elements.forEach(function(element) {
element.removeAttribute("open");
});
});
If I was able to assist you, please remember to give it a Like and Mark it as the Solution!
Let me know if need further assistance
Regards,
SideNode
I tried this and it did not work. Are there parameters I need to fill in to the code still? As with the OP, I don't like that the filter list is automatically set to the open position when arriving at the page. It would be much cleaner if the filter list was closed, and could be opened by the user if desired. We have our filter list set on the left hand side of the page, to the left of the products.
Looking for same answer. Code posted below didn't work for me, unless I am missing something.
User | RANK |
---|---|
41 | |
40 | |
24 | |
24 | |
22 |
Transform this holiday season into a shopping spree. Plus, learn how to effortlessly open ...
By Jasonh Dec 8, 2023Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023