To make it work as a menu instead of just an accordion, I need to find a way to keep one of the dropdowns open on page load.
If this clone is not the right way to build an accordion menu can anyone please point me to the right project. I’ve watched almost every accordion tutorials out there but they all are just acoordions so does not function like a menu.
Has there been any updates on this? I’m still experiencing the same thing. The code by Samliew works fine on inspector, tablet and mobile views but doesn’t behave the same on a normal desktop window.
From my perspective, this is a solution many people are looking for in multiple threads here.
Bonus: New update the day before which features automatic scroll for better UX.
Of course this can be disabled.
If you need an accordion in Webflow, I think this is a great design which features useful extra options when needed.
It’s been a while, but in case anyone is still trying to do this, Webflow targets the “Accordion_Toggle” element and listens for the “mousup” trigger to open and close the accordion.
Every accordion on your page has a unique ID that follows the naming convention “w-dropdown-toggle-1”, “w-dropdown-toggle-2”, etc.
If you always want the first accordion to be open on your page, you’d place the following code before the </body> tag:
For anyone following this method here, you’ll just want to make sure the page is loaded before running the code above, otherwise it will be overridden by any “initial state” animations.
Please tell- How could I ensure that- I built the accordion as per the webflow tutorial and tried making the first one open on page load using the code above but it’s not working.
I might be doing something wrong here- please let me know.
Because the first id is actually 0 not 1. No avail! I can clearly see that the dropdown element contains an ID array when inspecting code. I placed this code in body of page. Anyone else have luck?