The first-level menu and the second-level menu are written in two different ul lists to achieve hoverx display.

1: realize the second-level drop-down menu, the two menus are written in different block-level elements, simple hover to the first-level menu to display the corresponding second-level menu has been realized,
2: how to achieve hover, the mouse moves to the second-level menu, the second-level menu does not disappear. The second-level menu disappears only when the first-level menu or the corresponding second-level menu is removed;

Mar.18,2021

it is recommended to maintain different state parameters to keep the menu hidden, such as level_1_visible , level_2_visible , and then use events such as hover clicks to control the change of parameters corresponding to DOM

.
Menu