回答編集履歴

1

編集

2018/11/01 06:54

投稿

tomoyuki123
tomoyuki123

スコア273

test CHANGED
@@ -5,3 +5,43 @@
5
5
  changeColor = '#ae5e9b',;
6
6
 
7
7
  ```
8
+
9
+
10
+
11
+ 【追記】
12
+
13
+ console.log()を入れてみて、どうなるかお試しください。
14
+
15
+ 何も出力されないようならセレクタの指定が間違ってると思うので、そのときは質問文に該当のHTMLを記載して頂けると何かお答えできるかもしれません。
16
+
17
+ ```javascript
18
+
19
+ $(".s10w button:nth-child(-n+3)").on({
20
+
21
+ 'mouseover': function () {
22
+
23
+ console.log("mouseover");
24
+
25
+ $(this).stop(true).animate({
26
+
27
+ backgroundColor: changeColor
28
+
29
+ }, duration);
30
+
31
+ },
32
+
33
+ 'mouseout': function () {
34
+
35
+ console.log("mouseout");
36
+
37
+ $(this).stop(true).animate({
38
+
39
+ backgorundColor: defaultColor
40
+
41
+ }, duration);
42
+
43
+ }
44
+
45
+ });
46
+
47
+ ```