Is it possible to close the first div of a custom dropdown menu when opening the second?

Hello, I am wondering if it is possible to close my first div after opening the 2nd? I have created a custom dropdown menu with div’s with the webflow tutorial as reference and because of that i lost the function of the inbuilt dropdown menu to close the first tab upon opening the second.

Or mayby there is a way to overwrite the built in dropdown element of webflow for smoother animations?

code structure
Screenshot 2022-03-21 at 13.50.50

opening animation

closing animation
Screenshot 2022-03-21 at 16.41.14