質問するログイン新規登録

質問編集履歴

6

a

2018/03/29 23:35

投稿

roronoazoro
roronoazoro

スコア113

title CHANGED
File without changes
body CHANGED
@@ -136,7 +136,7 @@
136
136
  </div><!--contentWrap-->
137
137
  </div><!--None-->
138
138
 
139
- <script src="/javascripts/application.js" type="text/javascript" charset="utf-8" async defer>
139
+ <script>
140
140
  $(function(){
141
141
  $(".switch").on("click", function() {
142
142
  $(this).next().slideToggle();

5

tuiki

2018/03/29 23:35

投稿

roronoazoro
roronoazoro

スコア113

title CHANGED
File without changes
body CHANGED
@@ -10,48 +10,34 @@
10
10
  随時修正していこうと思っています。
11
11
  よろしくお願いします。
12
12
 
13
+ ![イメージ説明](bad9da8a09688e9cc2afd97abbdeefcf.png)
14
+
13
15
  ```html
14
- <p class="switch acoTitle">ここを押すとプラスマイナス
16
+ <!DOCTYPE html>
15
- <span class="accordion_icon active"><span></span><span></span></span></p>
16
- <div class="None">
17
+ <html lang="en" >
17
- <div class="contentWrap">
18
- <div class="acoWrap">
19
- <div class="acoPic">
20
- <img src="https://placehold.jp/300x300.png" alt="">
21
- </div>
22
- </div>
23
- <div class="acoWrap">
24
- <div class="acoPic">
25
- <img src="https://placehold.jp/300x300.png" alt="">
26
- </div>
27
- </div>
28
- <div class="acoWrap">
29
- <div class="acoPic">
30
- <img src="https://placehold.jp/300x300.png" alt="">
31
- </div>
32
- </div>
33
- </div><!--contentWrap-->
34
- </div><!--None-->
35
- ```
36
18
 
19
+ <head>
20
+ <meta charset="UTF-8">
21
+ <title>A Pen by kingkazuma7</title>
22
+ <!-- <link rel="stylesheet" href="css/style.css"> -->
37
- ```css
23
+ <style>
38
- .contentWrap {
24
+ .contentWrap {
39
- display: flex;
25
+ display: flex;
40
- width: 960px;
26
+ width: 960px;
41
27
  }
42
28
  .contentWrap .acoPic {
43
- margin-right: 30px;
29
+ margin-right: 30px;
44
30
  }
45
31
  .contentWrap .acoPic:nth-child(3) {
46
- margin-right: 0;
32
+ margin-right: 0;
47
33
  }
48
34
 
49
35
  .None {
50
36
  display: none;
51
37
  }
52
38
  .accordion_icon {
53
- width: 960px;
39
+ width: 960px;
54
- position: relative;
40
+ position: relative;
55
41
  width: 66px;
56
42
  height: 66px;
57
43
  background: #232e52;
@@ -62,63 +48,96 @@
62
48
  /* アコーディオン± */
63
49
  .accordion_icon,
64
50
  .accordion_icon span {
65
- display: inline-block;
51
+ display: inline-block;
66
- transition: all .4s;
52
+ transition: all .4s;
67
- box-sizing: border-box;
53
+ box-sizing: border-box;
68
54
  }
69
55
  .accordion_icon {
70
- position: relative;
56
+ position: relative;
71
- width: 66px;
57
+ width: 66px;
72
- height: 66px;
58
+ height: 66px;
73
- background: #232e52;
59
+ background: #232e52;
74
- position: absolute;
60
+ position: absolute;
75
- top: 0;
61
+ top: 0;
76
- right: 0;
62
+ right: 0;
77
63
  }
78
64
  .accordion_icon span {
79
- position: absolute;
65
+ position: absolute;
80
66
  left: 16px;
81
67
  width: 50%;
82
- height: 2px;
68
+ height: 2px;
83
69
  background-color: #fff;
84
- border-radius: 4px;
70
+ border-radius: 4px;
85
- -webkit-border-radius: 4px;
71
+ -webkit-border-radius: 4px;
86
- -ms-border-radius: 4px;
72
+ -ms-border-radius: 4px;
87
- -moz-border-radius: 4px;
73
+ -moz-border-radius: 4px;
88
- -o-border-radius: 4px;
74
+ -o-border-radius: 4px;
89
75
  }
90
76
  .accordion_icon span:nth-of-type(1) {
91
77
  top: 50%;
92
- transform: rotate(0deg);
78
+ transform: rotate(0deg);
93
79
  -webkit-transform: rotate(0deg);
94
- -moz-transform: rotate(0deg);
80
+ -moz-transform: rotate(0deg);
95
- -ms-transform: rotate(0deg);
81
+ -ms-transform: rotate(0deg);
96
82
  -o-transform: rotate(0deg);
97
83
  }
98
84
  .accordion_icon span:nth-of-type(2) {
99
85
  top: 35px;
100
- transform: rotate(90deg);
86
+ transform: rotate(90deg);
101
87
  -webkit-transform: rotate(90deg);
102
- -moz-transform: rotate(90deg);
88
+ -moz-transform: rotate(90deg);
103
- -ms-transform: rotate(90deg);
89
+ -ms-transform: rotate(90deg);
104
90
  -o-transform: rotate(90deg);
105
91
  }
106
92
  /*+、-切り替え*/
107
93
  .accordion_icon.active span:nth-of-type(1) {
108
- display:none;
94
+ display:none;
109
95
  }
110
96
  .accordion_icon.active span:nth-of-type(2) {
111
- top: 35px;
97
+ top: 35px;
112
- transform: rotate(180deg);
98
+ transform: rotate(180deg);
113
99
  -webkit-transform: rotate(180deg);
114
- -moz-transform: rotate(180deg);
100
+ -moz-transform: rotate(180deg);
115
- -ms-transform: rotate(180deg);
101
+ -ms-transform: rotate(180deg);
116
102
  -o-transform: rotate(180deg);
117
103
  }
118
- ```
119
104
 
105
+ .acoTitle {
106
+ font-size: 18px;
107
+ padding: 20px 0 20px 30px;
108
+ background: #EEE;
109
+ margin-bottom: 5px;
110
+ position: relative;
111
+ }
112
+ </style>
113
+ </head>
114
+
115
+ <body>
116
+
117
+ <p class="switch acoTitle">ここを押すとプラスマイナス
118
+ <span class="accordion_icon active"><span></span><span></span></span></p>
119
+ <div class="None">
120
+ <div class="contentWrap">
121
+ <div class="acoWrap">
122
+ <div class="acoPic">
123
+ <img src="https://placehold.jp/300x300.png" alt="">
120
- ```javascript
124
+ </div>
125
+ </div>
126
+ <div class="acoWrap">
127
+ <div class="acoPic">
128
+ <img src="https://placehold.jp/300x300.png" alt="">
129
+ </div>
130
+ </div>
131
+ <div class="acoWrap">
132
+ <div class="acoPic">
133
+ <img src="https://placehold.jp/300x300.png" alt="">
134
+ </div>
135
+ </div>
136
+ </div><!--contentWrap-->
137
+ </div><!--None-->
138
+
139
+ <script src="/javascripts/application.js" type="text/javascript" charset="utf-8" async defer>
121
- $(function(){
140
+ $(function(){
122
141
  $(".switch").on("click", function() {
123
142
  $(this).next().slideToggle();
124
143
  // activeが存在する場合
@@ -132,14 +151,9 @@
132
151
  }
133
152
  }); //switch終わり
134
153
  });
154
+ </script>
155
+ </body>
135
156
 
136
- // activeのつけはずしできてる、
137
- // $(function(){
157
+ </html>
138
- // $(".switch").on("click", function() {
139
158
 
140
- // $(this).next().slideToggle();
141
- // $(this).toggleClass("active");
142
-
143
- // }); //switch終わり
144
- // });
145
159
  ```

4

戻し

2018/03/29 23:29

投稿

roronoazoro
roronoazoro

スコア113

title CHANGED
File without changes
body CHANGED
@@ -1,5 +1,4 @@
1
- [あ](<p data-height="265" data-theme-id="0" data-slug-hash="WzzQaR" data-default-tab="css,result" data-user="kingkazuma7" data-embed-version="2" data-pen-title="WzzQaR" class="codepen">See the Pen <a href="https://codepen.io/kingkazuma7/pen/WzzQaR/">WzzQaR</a> by kingkazuma7 (<a href="https://codepen.io/kingkazuma7">@kingkazuma7</a>) on <a href="https://codepen.io">CodePen</a>.</p>
2
- <script async src="https://static.codepen.io/assets/embed/ei.js"></script>)jQueryでプラスマイナスでコンテンツを開け閉めすることがやりたいです。
1
+ jQueryでプラスマイナスでコンテンツを開け閉めすることがやりたいです。
3
2
  理想として下記サイトのような形でコンテンツを追加するということです。
4
3
  [開閉するアコーディオンメニューに使える!+から-へ、+から×へアイコンを切り替えるアニメーション](http://www.dataplan.jp/blog/css/3127)
5
4
 

3

追記

2018/03/29 23:22

投稿

roronoazoro
roronoazoro

スコア113

title CHANGED
File without changes
body CHANGED
@@ -1,4 +1,5 @@
1
- jQueryでプラスマイナスでコンテンツを開け閉めすることがやりたいです。
1
+ [あ](<p data-height="265" data-theme-id="0" data-slug-hash="WzzQaR" data-default-tab="css,result" data-user="kingkazuma7" data-embed-version="2" data-pen-title="WzzQaR" class="codepen">See the Pen <a href="https://codepen.io/kingkazuma7/pen/WzzQaR/">WzzQaR</a> by kingkazuma7 (<a href="https://codepen.io/kingkazuma7">@kingkazuma7</a>) on <a href="https://codepen.io">CodePen</a>.</p>
2
+ <script async src="https://static.codepen.io/assets/embed/ei.js"></script>)jQueryでプラスマイナスでコンテンツを開け閉めすることがやりたいです。
2
3
  理想として下記サイトのような形でコンテンツを追加するということです。
3
4
  [開閉するアコーディオンメニューに使える!+から-へ、+から×へアイコンを切り替えるアニメーション](http://www.dataplan.jp/blog/css/3127)
4
5
 
@@ -142,6 +143,4 @@
142
143
 
143
144
  // }); //switch終わり
144
145
  // });
145
- ```
146
- <iframe height='265' scrolling='no' title='WzzQaR' src='//codepen.io/kingkazuma7/embed/WzzQaR/?height=265&theme-id=0&default-tab=css,result&embed-version=2' frameborder='no' allowtransparency='true' allowfullscreen='true' style='width: 100%;'>See the Pen <a href='https://codepen.io/kingkazuma7/pen/WzzQaR/'>WzzQaR</a> by kingkazuma7 (<a href='https://codepen.io/kingkazuma7'>@kingkazuma7</a>) on <a href='https://codepen.io'>CodePen</a>.
147
- </iframe>
146
+ ```

2

追記

2018/03/29 23:20

投稿

roronoazoro
roronoazoro

スコア113

title CHANGED
File without changes
body CHANGED
@@ -143,5 +143,5 @@
143
143
  // }); //switch終わり
144
144
  // });
145
145
  ```
146
- <p data-height="265" data-theme-id="0" data-slug-hash="WzzQaR" data-default-tab="css,result" data-user="kingkazuma7" data-embed-version="2" data-pen-title="WzzQaR" class="codepen">See the Pen <a href="https://codepen.io/kingkazuma7/pen/WzzQaR/">WzzQaR</a> by kingkazuma7 (<a href="https://codepen.io/kingkazuma7">@kingkazuma7</a>) on <a href="https://codepen.io">CodePen</a>.</p>
147
- <script async src="https://static.codepen.io/assets/embed/ei.js"></script>
146
+ <iframe height='265' scrolling='no' title='WzzQaR' src='//codepen.io/kingkazuma7/embed/WzzQaR/?height=265&theme-id=0&default-tab=css,result&embed-version=2' frameborder='no' allowtransparency='true' allowfullscreen='true' style='width: 100%;'>See the Pen <a href='https://codepen.io/kingkazuma7/pen/WzzQaR/'>WzzQaR</a> by kingkazuma7 (<a href='https://codepen.io/kingkazuma7'>@kingkazuma7</a>) on <a href='https://codepen.io'>CodePen</a>.
147
+ </iframe>

1

追記

2018/03/29 23:17

投稿

roronoazoro
roronoazoro

スコア113

title CHANGED
File without changes
body CHANGED
@@ -142,4 +142,6 @@
142
142
 
143
143
  // }); //switch終わり
144
144
  // });
145
- ```
145
+ ```
146
+ <p data-height="265" data-theme-id="0" data-slug-hash="WzzQaR" data-default-tab="css,result" data-user="kingkazuma7" data-embed-version="2" data-pen-title="WzzQaR" class="codepen">See the Pen <a href="https://codepen.io/kingkazuma7/pen/WzzQaR/">WzzQaR</a> by kingkazuma7 (<a href="https://codepen.io/kingkazuma7">@kingkazuma7</a>) on <a href="https://codepen.io">CodePen</a>.</p>
147
+ <script async src="https://static.codepen.io/assets/embed/ei.js"></script>