回答編集履歴

1

コード追記

2020/12/08 13:10

投稿

hatena19
hatena19

スコア33740

test CHANGED
@@ -77,3 +77,53 @@
77
77
  ```
78
78
 
79
79
  [CodePenサンプル](https://codepen.io/hatena19/pen/mdrEGWK?editors=0010)
80
+
81
+
82
+
83
+
84
+
85
+ ---
86
+
87
+ 解決済みですが、別案を思いついたので追記しておきます。
88
+
89
+ こちらの方がスマートのような気がします。
90
+
91
+
92
+
93
+ `.stop()`で動作中のアニメーションを止めてから、fadeIn または fadeOutします。
94
+
95
+
96
+
97
+ ```jQuery
98
+
99
+ $(function(){
100
+
101
+ var setTimeoutConst;
102
+
103
+ $('.surfboard-modal-open').hover(
104
+
105
+ function(){
106
+
107
+ $('#nav-modal-surfboard').stop().fadeIn();
108
+
109
+ },
110
+
111
+ function(){
112
+
113
+ $('#nav-modal-surfboard').stop().fadeOut();
114
+
115
+ }
116
+
117
+ );
118
+
119
+ });
120
+
121
+ ```
122
+
123
+ [CodePenサンプル](https://codepen.io/hatena19/pen/MWjezWX?editors=0010)
124
+
125
+
126
+
127
+ 参考リンク
128
+
129
+ [jQuery入門講座 使い方-アニメの停止](https://www.jquerystudy.info/tutorial/basic/stop.html)