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;
}