问题
Hi my fancy box image keeps disappearing whenever I click on the image,the fancy box displays the image but once I close it theirs no image. Where am I going wrong?
Fancybox javascript:
$(document).ready(function() {
$(".single_image").fancybox();
});
Fancybox Image:
<%= link_to(image_tag"blindlogo.jpg", :class=>"single_image") %>
回答1:
Updated
Try to add following codes below your link_to codes, so it looks like:
<%= link_to "#", "assets/blindlogo.jpg", :class=>"single_image" %>
See http://fancybox.net/howto. This page says you need href in your link element.
来源:https://stackoverflow.com/questions/9940103/fancy-box-making-image-disappear-on-rails