How to set dropdown to open on default in Webflow
Вставка
- Опубліковано 31 сер 2022
- Here’s how you can have a dropdown open on default in webflow with a little Jquery assistance. Code below
DISCLAIMER: Since I recorded this it's been found that this code doesn't seem to work when interactions are applied to the dropdown. Keep in mind! May record a more comprehensive update some time:
$(document).ready(function() {
$('#toggle-1').addClass('w--open');
$('#dropdown-list-1').addClass('w--open');
$('.dropdown-wrap').on('click',function() {
$('#toggle-1').removeClass('w--open');
$('#dropdown-list-1').removeClass('w--open');
});
});
-----------------------------------------------
✨ ABOUT ME
Hi! I'm KC Katalbas. I'm a web designer, developer, and maker of things. I'm based in Nashville, Tennessee where I also make art and music.
-----------------------------------------------
✨ KC KAT CREATIVE
www.kckat.com/
/ kckatcreative
webflow.com/kckatcreative
-----------------------------------------------
✨ MUSIC & TECH
Music from Artlist.io. All music by the artist Aves
Works great, thank you for sharing! 😍
Thanks a lot! Exactly what I needed 😍
great video, I was actually trying to fix that one dropdown covers other dropdowns when open and you answered that too. Thanks!
This was exactly what I needed. I'm trying to link to an open accordion when you click a button from another page. so I added some code to look at the anchor that's in the url and if it's there there then open this specific accordion item. It works when I turn off interactions but no way to close which sucks. So you're right it doesn't seem to work when interactions are applied to the dropdown. I'd love to see an update or a workaround for this!
I decided to turn off all interactions on the accordions and create the accordion toggle myself with jquery. now this code works! very happy.
Thanks a lot. VERY HELPFUL!
Thank youuuuu !
life saver!!
“Codey-poo”
Great vid!
Thank you! Is it ok to add the 'window.innerWidth' property? to make the code only working on mobile?
Hi Katie, thanks alot for the video. I want to get your opinion on what platform/source is best to learn webflow sites from beginner-advanced as fast and quickly as possible? Is it a specific Udemy course, or is it through their own Webflow university courses, Or any other resource that you think is the best and fastest way to learn?(Looking for a single resource, maybe a single long video that covers all/most of the stuff.) Secondly, I would like to get your opinion on my Webflow project idea which includes in it some Ecommerce functionality. I just added you over linkedin for further communication, let me know please when you get the chance to reply,best
Thank you so much, it worked like a charm
Hi Katie, please i need help, can you tell me how to change width on dropdown list and also be responsive. I want to change width to 1200px
I tried this using classes instead of ID's. Does it only work when using ID's?
I've done all the same, checked names and it's not working