â–Ľ
Streaming live at 10am (PST)

Close all dropdown when another opens

Hello people

I am trying to write a jquery code to close all open dropdowns that have the combo class current and then give the new open dropdown the combo class current.

$('.dropdown__trigger').on('click', function() {
  $('.current').click();
  $('.dropdown__trigger').removeClass('current');
  $(this).addClass('current');
});

Here is my site Read-Only: Webflow - Diamantin AG
(how to share your site Read-Only link)

Are you looking for help? Does it work?

1 Like

@vincent I’m searching for help. It just doesn’t work.