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

質問編集履歴

4

記述間違いなどを修正しました。

2016/09/06 13:09

投稿

upplus
upplus

スコア11

title CHANGED
File without changes
body CHANGED
@@ -45,10 +45,6 @@
45
45
  background: url(images/bg-white-brick.jpg) repeat;
46
46
  }
47
47
 
48
- #visual_event .visual_margin {
49
- margin-top: -150px;
50
- }
51
-
52
48
  #visual_event .boxed-white {
53
49
  widht: 100%;
54
50
  background: #fff;
@@ -56,12 +52,6 @@
56
52
  margin-bottom: 30px;
57
53
  }
58
54
 
59
- #visual_event .visual-title-p{
60
- color: #888;
61
- margin-top: 15px;
62
- margin-bottom: -5px;
63
- }
64
-
65
55
  #visual_event h5 a{
66
56
  text-decoration: none;
67
57
  font-size: 17px;
@@ -104,7 +94,7 @@
104
94
  transition: .3s;
105
95
  }
106
96
 
107
- #visual_event .visual-img img,
97
+ #visual_event .visual-img img{
108
98
  width: auto;
109
99
  height: auto;
110
100
  max-width: 100%;

3

スクリプト、ループを外す場所を変更。CSSを追加。

2016/09/06 13:08

投稿

upplus
upplus

スコア11

title CHANGED
File without changes
body CHANGED
@@ -15,18 +15,19 @@
15
15
  ###発生している問題・エラーメッセージ
16
16
 
17
17
  ```
18
- 現状は初期表示1BOXでもっと見るボタンを押したら1個ずつ
19
- 投稿が出ます。。。
20
- ここからどうすればいいかわからないす。。。
18
+ 投稿ボックスが全部出た状態にってす。
21
- ワードプレスの投稿にする以前は
22
- .show_boxに.boxed-whiteを3個ずつ入れて
23
- 使っていたのですが。。。
24
19
  ```
25
20
 
26
21
  ###該当のソースコード
27
22
  ```ここに言語を入力
28
23
  <script>
24
+ jQuery( '.show_box:gt(2)' ).addClass( 'show_box_hide' ).hide();
25
+ jQuery( '.more' ).on( 'click', function() {
26
+ jQuery( '.show_box_hide:lt(3)').removeClass( 'show_box_hide' ).slideDown( 'fast' );
27
+ if ( jQuery( '.show_box.show_box_hide' ).length === 0 ) { jQuery( '.more' ).hide(); }
28
+ } );
29
+
29
- jQuery(function(){
30
+ */jQuery(function(){
30
31
  jQuery('.show_box:not(.show_box:first-of-type)').css('display','none');
31
32
  jQuery('.more').nextAll('.more').css('display','none');
32
33
  jQuery('.more').on('click', function() {
@@ -34,9 +35,100 @@
34
35
  jQuery(this).next('.show_box').slideDown('fast');
35
36
  jQuery(this).nextAll('.more:first').css('display','block');
36
37
  });
37
- });
38
+ });*/
38
39
  </script>
39
40
 
41
+ <style>
42
+ #visual_event{
43
+ width: 100%;
44
+ height: 100%;
45
+ background: url(images/bg-white-brick.jpg) repeat;
46
+ }
47
+
48
+ #visual_event .visual_margin {
49
+ margin-top: -150px;
50
+ }
51
+
52
+ #visual_event .boxed-white {
53
+ widht: 100%;
54
+ background: #fff;
55
+ padding: 15px;
56
+ margin-bottom: 30px;
57
+ }
58
+
59
+ #visual_event .visual-title-p{
60
+ color: #888;
61
+ margin-top: 15px;
62
+ margin-bottom: -5px;
63
+ }
64
+
65
+ #visual_event h5 a{
66
+ text-decoration: none;
67
+ font-size: 17px;
68
+ line-height: 1.7;
69
+ margin-top: 8px;
70
+ font-weight: bold;
71
+ }
72
+
73
+ #visual_event h5 a{
74
+ color: #888;
75
+ margin: 15px 0 !important;
76
+ }
77
+
78
+ #visual_event i{
79
+ position: relative;
80
+ right: 3px;
81
+ top: 3px;
82
+ }
83
+
84
+ #visual_event .event-more-box a{
85
+ font-size: 13px;
86
+ color: #fff;
87
+ font-weight: bold;
88
+ height: 50px;
89
+ line-height: 50px;
90
+ background: #999;
91
+ text-decoration: none;
92
+ display: block;
93
+ margin-bottom: -10px;
94
+ }
95
+
96
+ #visual_event .event-more-box a:hover{
97
+ color: #999;
98
+ background: #fff;
99
+ border: 1px solid #999;
100
+ -webkit-transition: .3s;
101
+ -moz-transition: .3s;
102
+ -ms-transition: .3s;
103
+ -o-transition: .3s;
104
+ transition: .3s;
105
+ }
106
+
107
+ #visual_event .visual-img img,
108
+ width: auto;
109
+ height: auto;
110
+ max-width: 100%;
111
+ max-height: 100%;
112
+ }
113
+
114
+ #visual_event .box-more{
115
+ cursor: pointer;
116
+ font-size: 18px;
117
+ color: #909090;
118
+ font-weight: bold;
119
+ padding: 10px 0;
120
+ background: -moz-linear-gradient(top,#FFF 0%,#EEE);
121
+ background: -webkit-gradient(linear, left top, left bottom, from(#FFF), to(#EEE));
122
+ border: 1px solid #aaa;
123
+ }
124
+ </style>
125
+
126
+
127
+ <!-- visual_event -->
128
+ <section id="visual_event" class="top_bottom_margin bg-gray">
129
+ <div class="visual_margin container">
130
+ <div class="row">
131
+
40
132
  <?php $my_query = new WP_Query( 'category_name=event' ); ?>
41
133
  <?php if ( $my_query->have_posts() ) :while ( $my_query->have_posts() ) : $my_query->the_post(); ?>
42
134
  <!-- show_box -->
@@ -63,30 +155,35 @@
63
155
  <i class="fa fa-angle-double-right fa-2x"></i> READ MORE | 詳細を見る</a></p>
64
156
  </div>
65
157
  </div>
66
- <!-- /boxed-white -->
158
+ <!-- boxed-white -->
67
159
 
68
160
  </div>
69
- <!-- /show_box -->
161
+ <!-- show_box -->
70
162
 
163
+ <?php endwhile; /* ボタンをループから外す */ ?>
164
+
71
- <!-- もっと見るボタン -->
165
+ <!-- もっと見る -->
72
166
  <div class="more">
73
167
  <div class="col-md-12">
74
168
  <p class="box-more text-center">もっと見る</p>
75
169
  </div>
76
170
  </div>
77
- <!-- /もっと見るボタン -->
171
+ <!-- もっと見る -->
78
172
 
79
- <?php endwhile; else: ?>
173
+ <?php else: ?>
80
174
  <p>記事はありません</p>
81
175
  <?php endif; ?>
176
+
177
+ </div>
178
+ </div>
179
+ </section>
180
+ <!-- visual_event ********************************************************************↑-->
181
+
82
182
  ```
83
183
 
84
184
  ###試したこと
85
- HTMLを初め6ヶ月くらいの素人でし。。。
185
+ ご親切に教えていただいたもを参考にさせいただき、
86
- 調べていろいろ試して見たんですが
87
- 正常に動かないです。。。
186
+ 格闘中です。。。
88
- すいません。
89
- お手数ですがお助けください。
90
187
 
91
188
  ###補足情報(言語/FW/ツール等のバージョンなど)
92
- ワードプレスを仕様 HTML5
189
+ ワードプレスを仕様 HTML5 bootstrap

2

#から\.の記述間違いを直しました。

2016/09/06 13:04

投稿

upplus
upplus

スコア11

title CHANGED
File without changes
body CHANGED
@@ -1,5 +1,5 @@
1
1
  ###前提・実現したいこと
2
- 初期表示→ワードプレスのループを使って#boxed-whiteを6BOX表示
2
+ 初期表示→ワードプレスのループを使って.boxed-whiteを6BOX表示
3
3
  もっと見るボタン押す→3BOXずつ表示したい
4
4
 
5
5
  □ □ □
@@ -19,7 +19,7 @@
19
19
  投稿が出ます。。。
20
20
  ここからどうすればいいかわからないです。。。
21
21
  ワードプレスの投稿にする以前は
22
- #show_boxに#boxed-whiteを3個ずつ入れて
22
+ .show_boxに.boxed-whiteを3個ずつ入れて
23
23
  使っていたのですが。。。
24
24
  ```
25
25
 

1

scriptの書式の改善

2016/09/06 06:36

投稿

upplus
upplus

スコア11

title CHANGED
File without changes
body CHANGED
@@ -34,6 +34,7 @@
34
34
  jQuery(this).next('.show_box').slideDown('fast');
35
35
  jQuery(this).nextAll('.more:first').css('display','block');
36
36
  });
37
+ });
37
38
  </script>
38
39
 
39
40
  <?php $my_query = new WP_Query( 'category_name=event' ); ?>