質問編集履歴
2
タグの追加
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
1
コードの記述
test
CHANGED
File without changes
|
test
CHANGED
@@ -1 +1,167 @@
|
|
1
1
|
トップページにbxsliderを設置し写真をスライド出来るようにしましたが、トップページに戻ろうとするとビューが乱れ写真がバラバラになってしまいます。更新ボタンを押すと乱れていたビューが元に戻ります。
|
2
|
+
|
3
|
+
どなたか分かりますでしょうか?
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
症状はこちらになります
|
8
|
+
|
9
|
+
https://gyazo.com/7e9ced9706a3b31e7b64e392c9b5ecce
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
```ruby(application.html)
|
14
|
+
|
15
|
+
<!DOCTYPE html>
|
16
|
+
|
17
|
+
<html>
|
18
|
+
|
19
|
+
<head>
|
20
|
+
|
21
|
+
<title>Matsubokkuri</title>
|
22
|
+
|
23
|
+
<%= csrf_meta_tags %>
|
24
|
+
|
25
|
+
<%= csp_meta_tag %>
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
|
30
|
+
|
31
|
+
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/bxslider/4.2.12/jquery.bxslider.css">
|
36
|
+
|
37
|
+
<script src="https://cdn.jsdelivr.net/bxslider/4.2.12/jquery.bxslider.min.js"></script>
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
<script>
|
44
|
+
|
45
|
+
$(document).ready(function(){
|
46
|
+
|
47
|
+
$('.bxslider').bxSlider({
|
48
|
+
|
49
|
+
auto: true
|
50
|
+
|
51
|
+
touchEnabled: false
|
52
|
+
|
53
|
+
});
|
54
|
+
|
55
|
+
});
|
56
|
+
|
57
|
+
</script>
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
</head>
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
<body>
|
66
|
+
|
67
|
+
<header class="header">
|
68
|
+
|
69
|
+
<div class="header__bar row">
|
70
|
+
|
71
|
+
<h1 class="grid-6">
|
72
|
+
|
73
|
+
<a href="/">Matsubokkuri</a></h1>
|
74
|
+
|
75
|
+
<div class="tento"><img src="/assets/camp008.png"></div>
|
76
|
+
|
77
|
+
<%= link_to "toppage", root_path, class: "toppage" %>
|
78
|
+
|
79
|
+
<% if user_signed_in? %>
|
80
|
+
|
81
|
+
<div class="user_nav grid-6">
|
82
|
+
|
83
|
+
<span><%= current_user.nickname %>
|
84
|
+
|
85
|
+
<div class="user__info">
|
86
|
+
|
87
|
+
<%= link_to "マイページ", "/users/#{current_user.id}" %>
|
88
|
+
|
89
|
+
<%= link_to "ログアウト", destroy_user_session_path, method: :delete %>
|
90
|
+
|
91
|
+
</div>
|
92
|
+
|
93
|
+
</span>
|
94
|
+
|
95
|
+
<%= link_to "投稿する", new_tweet_path, class: "push" %>
|
96
|
+
|
97
|
+
</div>
|
98
|
+
|
99
|
+
<% else %>
|
100
|
+
|
101
|
+
<div class="grid-6">
|
102
|
+
|
103
|
+
<%= link_to "ログイン", new_user_session_path, class: "post" %>
|
104
|
+
|
105
|
+
<%= link_to "新規登録", new_user_registration_path, class: "post" %>
|
106
|
+
|
107
|
+
</div>
|
108
|
+
|
109
|
+
<% end %>
|
110
|
+
|
111
|
+
</div>
|
112
|
+
|
113
|
+
</header>
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
<div class="bxslider">
|
118
|
+
|
119
|
+
<div class="bxslider_slider"><img src="/assets/coffee1.jpg" title="" ></div>
|
120
|
+
|
121
|
+
<div class="bxslider_slider"><img src="/assets/coffee2.jpg" title="" ></div>
|
122
|
+
|
123
|
+
<div class="bxslider_slider"><img src="/assets/coffee3.jpg" title="" ></div>
|
124
|
+
|
125
|
+
</div>
|
126
|
+
|
127
|
+
<%= yield %>
|
128
|
+
|
129
|
+
<footer>
|
130
|
+
|
131
|
+
<p>
|
132
|
+
|
133
|
+
Copyright Matsubokkuri 2021.
|
134
|
+
|
135
|
+
</p>
|
136
|
+
|
137
|
+
</footer>
|
138
|
+
|
139
|
+
</body>
|
140
|
+
|
141
|
+
</html>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
```
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
```javascript(bxslider.js)
|
150
|
+
|
151
|
+
$(function(){
|
152
|
+
|
153
|
+
$('.bxslider').bxSlider({
|
154
|
+
|
155
|
+
mode: 'fade',
|
156
|
+
|
157
|
+
captions: true,
|
158
|
+
|
159
|
+
auto: true,
|
160
|
+
|
161
|
+
slideWidth: 2000,
|
162
|
+
|
163
|
+
});
|
164
|
+
|
165
|
+
});
|
166
|
+
|
167
|
+
```
|