回答編集履歴
1
修正
test
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
onのついた自分自身を再度クリックしたときにonを外すかどうかですね
|
2
|
+
|
3
|
+
(修正しました)
|
2
4
|
|
3
5
|
|
4
6
|
|
@@ -10,9 +12,9 @@
|
|
10
12
|
|
11
13
|
$('li').click(function(){
|
12
14
|
|
13
|
-
$(this).
|
15
|
+
$(this).siblings().removeClass('on');
|
14
16
|
|
15
|
-
$(this).
|
17
|
+
$(this).addClass('on');
|
16
18
|
|
17
19
|
});
|
18
20
|
|
@@ -30,11 +32,9 @@
|
|
30
32
|
|
31
33
|
$('li').click(function(){
|
32
34
|
|
33
|
-
|
35
|
+
$(this).siblings().removeClass('on');
|
34
36
|
|
35
|
-
$(this).parent('ul').find('li').removeClass('on');
|
36
|
-
|
37
|
-
$(this).toggleClass('on'
|
37
|
+
$(this).toggleClass('on');
|
38
38
|
|
39
39
|
});
|
40
40
|
|