回答編集履歴
3
chousei
test
CHANGED
@@ -14,11 +14,13 @@
|
|
14
14
|
|
15
15
|
# 調整版
|
16
16
|
|
17
|
+
content→item
|
18
|
+
|
17
19
|
```javascript
|
18
20
|
|
19
21
|
<style>
|
20
22
|
|
21
|
-
.
|
23
|
+
.item.current{
|
22
24
|
|
23
25
|
color:aqua;
|
24
26
|
|
@@ -48,7 +50,7 @@
|
|
48
50
|
|
49
51
|
return $(this).prop('href').match(href);
|
50
52
|
|
51
|
-
}).closest('.subNav').addClass('current').closest('.
|
53
|
+
}).closest('.subNav').addClass('current').closest('.item').addClass('current');
|
52
54
|
|
53
55
|
$('a').filter(function(){
|
54
56
|
|
2
chousei
test
CHANGED
@@ -11,3 +11,99 @@
|
|
11
11
|
});
|
12
12
|
|
13
13
|
```
|
14
|
+
|
15
|
+
# 調整版
|
16
|
+
|
17
|
+
```javascript
|
18
|
+
|
19
|
+
<style>
|
20
|
+
|
21
|
+
.contents.current{
|
22
|
+
|
23
|
+
color:aqua;
|
24
|
+
|
25
|
+
}
|
26
|
+
|
27
|
+
.subNav.current{
|
28
|
+
|
29
|
+
color:lime;
|
30
|
+
|
31
|
+
}
|
32
|
+
|
33
|
+
</style>
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
|
38
|
+
|
39
|
+
<script>
|
40
|
+
|
41
|
+
$(function(){
|
42
|
+
|
43
|
+
$('.current').removeClass('current');
|
44
|
+
|
45
|
+
var href = location.href.match(/.+?(?=[?#]|$)/)[0];
|
46
|
+
|
47
|
+
$('a').filter(function(){
|
48
|
+
|
49
|
+
return $(this).prop('href').match(href);
|
50
|
+
|
51
|
+
}).closest('.subNav').addClass('current').closest('.contents').addClass('current');
|
52
|
+
|
53
|
+
$('a').filter(function(){
|
54
|
+
|
55
|
+
return $(this).prop('href').match(href);
|
56
|
+
|
57
|
+
}).closest('.subNav').prevAll('.acc-subOpen').prop('checked',true);
|
58
|
+
|
59
|
+
});
|
60
|
+
|
61
|
+
</script>
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
<div id="mainNavBox">
|
68
|
+
|
69
|
+
<ul class="contents">
|
70
|
+
|
71
|
+
<li class="item">
|
72
|
+
|
73
|
+
<input id="acc-subOpen-home" class="acc-subOpen" type="checkbox">
|
74
|
+
|
75
|
+
<label class="acc-unshown" for="acc-subOpen-home">Home</label>
|
76
|
+
|
77
|
+
<ul class="subNav">
|
78
|
+
|
79
|
+
<li class="current"><a href="./top.html">トップページ</a></li>
|
80
|
+
|
81
|
+
<li><a href="#">お知らせ一覧</a></li>
|
82
|
+
|
83
|
+
<li><a href="#">リリースノート一覧</a></li>
|
84
|
+
|
85
|
+
</ul>
|
86
|
+
|
87
|
+
</li>
|
88
|
+
|
89
|
+
<li class="item">
|
90
|
+
|
91
|
+
<input id="accSP-subOpen-home" class="acc-subOpen" type="checkbox">
|
92
|
+
|
93
|
+
<label class="acc-unshown" for="accSP-subOpen-home">マイページ</label>
|
94
|
+
|
95
|
+
<ul class="subNav">
|
96
|
+
|
97
|
+
<li><a href="profile.html">プロフィール</a></li>
|
98
|
+
|
99
|
+
<li><a href="keiyaku.html">契約状況</a></li>
|
100
|
+
|
101
|
+
</ul>
|
102
|
+
|
103
|
+
</li>
|
104
|
+
|
105
|
+
</ul>
|
106
|
+
|
107
|
+
</div>
|
108
|
+
|
109
|
+
```
|
1
chousei
test
CHANGED
@@ -6,6 +6,8 @@
|
|
6
6
|
|
7
7
|
$('.contents:has(a[href="'+href+'"]),.subNav:has(a[href="'+href+'"])').addClass('current');
|
8
8
|
|
9
|
+
$('.subNav:has(a[href="'+href+'"])').prevAll('.acc-subOpen').prop('checked',true);
|
10
|
+
|
9
11
|
});
|
10
12
|
|
11
13
|
```
|