0
我在页面上有可点击的图片。当我在Safari移动版上尝试时,它们不可点击。我注意到的一件事是,如果我没有在页面上分页,那么我可以点击图像。在我注意到我确实尝试了这个答案Clickable Images not working on iPhone/Android之前,但它没有帮助。我还注意到,如果我按下并按住图像,它就是正在选中的分页链接。当Safari页面上的页面分页时,图片不可点击
我正在使用导轨。这里是我的局部视图:
<% @videos.each do |v| %>
<div class="vidframe">
<a href="<%= video_path(v) %>" data-remote="true"><%= image_tag v.thumbnail.url, alt: 'thumbnail:' + v.title, title: v.title, class: 'vid-thumbnail'%></a>
</div>
<% if parent_mode? %>
<div class="mngbuttons">
<%= form_for(:video, url: video_path(v), method: :patch, remote: true) do |f| %>
<%= f.hidden_field :approved, value: 'true' %>
<%= f.submit "Approve", data: { confirm: 'Approve: Are you sure?' }, class: 'btn btn-primary mng-button' %>
<% end %>
<%= link_to "Delete", video_path(v), method: :delete, remote: true, data: { confirm: 'Delete: Are you sure?' }, class: 'btn btn-primary mng-button' %>
</div>
<% end %>
<% end %>
<div id="video_paginate" class="col-md-12">
<% if parent_mode? %>
<%= will_paginate @videos, params: { controller: 'static_pages', action: 'parent' } %>
<% else %>
<%= will_paginate @videos, params: { controller: 'static_pages', action: 'home' } %>
<% end %>
</div>
这里是我的页面的CSS:
/* Videos */
.vidframe, .mngbuttons {
float: left;
height: 92px;
padding: 1px;
}
/* Make links work on Safari Mobile, hopefully */
.vid-thumbnail {
cursor: pointer;
}