質問編集履歴
1
コードの記載とやったことの説明
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,4 +6,174 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
+
```
|
10
|
+
|
11
|
+
<style>
|
12
|
+
|
13
|
+
.ms-webpart-chrome h2 {
|
14
|
+
|
15
|
+
position: relative;
|
16
|
+
|
17
|
+
margin: 0 0 4px;
|
18
|
+
|
19
|
+
padding: 0.8em 0 0.8em 1.5em;
|
20
|
+
|
21
|
+
border: 2px solid #993366;
|
22
|
+
|
23
|
+
font-size: 1.143em;
|
24
|
+
|
25
|
+
font-weight: bold;
|
26
|
+
|
27
|
+
background-color: #FFEEFF;
|
28
|
+
|
29
|
+
}
|
30
|
+
|
31
|
+
.ms-webpart-chrome h2:before {
|
32
|
+
|
33
|
+
content: "";
|
34
|
+
|
35
|
+
position: absolute;
|
36
|
+
|
37
|
+
background: #882255;
|
38
|
+
|
39
|
+
top: 50%;
|
40
|
+
|
41
|
+
left: 0.5em;
|
42
|
+
|
43
|
+
margin-top: -15px;
|
44
|
+
|
45
|
+
height: 30px;
|
46
|
+
|
47
|
+
width: 8px;
|
48
|
+
|
49
|
+
border-radius: 2px;
|
50
|
+
|
51
|
+
-webkit-border-radius: 2px;
|
52
|
+
|
53
|
+
-moz-border-radius: 2px;
|
54
|
+
|
55
|
+
}
|
56
|
+
|
57
|
+
.ms-webpart-chrome h2:after {
|
58
|
+
|
59
|
+
display: block;
|
60
|
+
|
61
|
+
content: "";
|
62
|
+
|
63
|
+
position: absolute;
|
64
|
+
|
65
|
+
top: 50%;
|
66
|
+
|
67
|
+
right: 10px;
|
68
|
+
|
69
|
+
width: 7px;
|
70
|
+
|
71
|
+
height: 7px;
|
72
|
+
|
73
|
+
margin-top: -4px;
|
74
|
+
|
75
|
+
border-top: solid 2px #7f7f7f;
|
76
|
+
|
77
|
+
border-right: solid 2px #7f7f7f;
|
78
|
+
|
79
|
+
transform: rotate(135deg);
|
80
|
+
|
81
|
+
-webkit-transform: rotate(135deg);
|
82
|
+
|
83
|
+
transition: .2s;
|
84
|
+
|
85
|
+
}
|
86
|
+
|
87
|
+
.ms-webpart-chrome .closed h2:after {
|
88
|
+
|
89
|
+
transform: rotate(45deg);
|
90
|
+
|
91
|
+
-webkit-transform: rotate(45deg);
|
92
|
+
|
93
|
+
}
|
94
|
+
|
95
|
+
</style>
|
96
|
+
|
97
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
|
98
|
+
|
99
|
+
<script>
|
100
|
+
|
101
|
+
(function ($) {
|
102
|
+
|
103
|
+
$.fn.extend({
|
104
|
+
|
105
|
+
BodyToggle: function (speed) {
|
106
|
+
|
107
|
+
$(this).toggleClass('closed');
|
108
|
+
|
109
|
+
$(this).next().slideToggle(speed);
|
110
|
+
|
111
|
+
},
|
112
|
+
|
113
|
+
});
|
114
|
+
|
115
|
+
$('.ms-webpart-chrome-title').click(function () {
|
116
|
+
|
117
|
+
$(this).BodyToggle('normal');
|
118
|
+
|
119
|
+
});
|
120
|
+
|
121
|
+
})(jQuery);
|
122
|
+
|
123
|
+
</script>
|
124
|
+
|
125
|
+
```
|
126
|
+
|
127
|
+
上記を[スクリプト エディター] の [スニペットを編集] で挿入しました。
|
128
|
+
|
9
129
|
閉じた状態で始まるようにするにはどうすればよいでしょうか?
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
やったこと
|
134
|
+
|
135
|
+
<scrip>以下が理解できていませんが、下記を試してみました。。
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
1.$入れ変え
|
140
|
+
|
141
|
+
$('.ms-webpart-chrome-title').click(function () {
|
142
|
+
|
143
|
+
$(this).BodyToggle('normal');
|
144
|
+
|
145
|
+
});
|
146
|
+
|
147
|
+
$.fn.extend({
|
148
|
+
|
149
|
+
BodyToggle: function (speed) {
|
150
|
+
|
151
|
+
$(this).toggleClass('closed');
|
152
|
+
|
153
|
+
$(this).next().slideToggle(speed);
|
154
|
+
|
155
|
+
},
|
156
|
+
|
157
|
+
});
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
2. closedとnormalの入れ替え
|
162
|
+
|
163
|
+
$.fn.extend({
|
164
|
+
|
165
|
+
BodyToggle: function (speed) {
|
166
|
+
|
167
|
+
$(this).toggleClass('normal');
|
168
|
+
|
169
|
+
$(this).next().slideToggle(speed);
|
170
|
+
|
171
|
+
},
|
172
|
+
|
173
|
+
});
|
174
|
+
|
175
|
+
$('.ms-webpart-chrome-title').click(function () {
|
176
|
+
|
177
|
+
$(this).BodyToggle('closed');
|
178
|
+
|
179
|
+
});
|