Fancy box making image disappear on rails

大城市里の小女人 提交于 2019-12-24 22:59:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!