回答編集履歴

1

コード修正

2021/02/09 13:13

投稿

hatena19
hatena19

スコア33790

test CHANGED
@@ -6,14 +6,24 @@
6
6
 
7
7
  ```js
8
8
 
9
- $('.menu').mouseover(function(e) {
9
+ $('.menu').mouseover(function(e) {
10
+
11
+ setTimeout(() => $(this).children().css("display","block"), 0);
12
+
13
+ $(this).children().removeClass("hide");
14
+
15
+ })
10
16
 
11
17
 
12
18
 
13
- setTimeout(() => $(this).children().style.display = "block", 0);
19
+ $('.menu').mouseout(function(e) {
14
20
 
15
- $(this).children().removeClass("hide");
21
+ $('.sub-menu-list').addClass("hide");
16
22
 
23
+ setTimeout(() => $(this).children().css("display","none"), 200);
24
+
25
+ // opacityが0になるタイミングでdisplay:noneを付与する
26
+
17
- })
27
+ })
18
28
 
19
29
  ```