回答編集履歴
1
ついき
test
CHANGED
@@ -47,3 +47,57 @@
|
|
47
47
|
</div>
|
48
48
|
|
49
49
|
```
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
# 最初非表示
|
54
|
+
|
55
|
+
```javascript
|
56
|
+
|
57
|
+
<script>
|
58
|
+
|
59
|
+
$(function(){
|
60
|
+
|
61
|
+
$('.toggle-box').hide();
|
62
|
+
|
63
|
+
$('a[data-target]').on('click',function(e){
|
64
|
+
|
65
|
+
e.preventDefault();
|
66
|
+
|
67
|
+
$('.toggle-box').filter('.'+$(this).data('target')).slideToggle('slow');
|
68
|
+
|
69
|
+
$('.toggle-box').not('.'+$(this).data('target')).slideUp('slow');
|
70
|
+
|
71
|
+
});
|
72
|
+
|
73
|
+
});
|
74
|
+
|
75
|
+
</script>
|
76
|
+
|
77
|
+
<a href="#" data-target="a1">あああ</a>
|
78
|
+
|
79
|
+
<a href="#" data-target="a2">いいい</a>
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
<div class="toggle-box a1">
|
84
|
+
|
85
|
+
<p>
|
86
|
+
|
87
|
+
あああ
|
88
|
+
|
89
|
+
</p>
|
90
|
+
|
91
|
+
</div>
|
92
|
+
|
93
|
+
<div class="toggle-box a2">
|
94
|
+
|
95
|
+
<p>
|
96
|
+
|
97
|
+
いいい
|
98
|
+
|
99
|
+
</p>
|
100
|
+
|
101
|
+
</div>
|
102
|
+
|
103
|
+
```
|