FancyBox在没有扩展名的情况下不使用网址

时间:2014-12-10 22:09:11

标签: java jquery image spring-mvc fancybox

我有以下代码:

$(document).ready(function() {
    $(".image").fancybox({
          helpers: {
              title : {
                  type : 'float'
              }
          }
      }); 

});
    </script>

</head>
<body>
    <a class="image" href="http://farm4.staticflickr.com/3712/9032543579_1217e6566b_m.jpg"  title="Singapore from the air (Andrew Tan 2011)">
<img src="http://farm4.staticflickr.com/3712/9032543579_1217e6566b_m.jpg" alt="" />

单击图像时按预期工作:

enter image description here

如果像这样改写身体:

<a class="image" href="http://localhost:9091/member/createCompany/getOriginalImage/1"  title="Singapore from the air (Andrew Tan 2011)">
<img src="http://farm4.staticflickr.com/3712/9032543579_1217e6566b_m.jpg" alt="" />

点击图片后,我看到以下结果:

enter image description here

我不明白是什么问题。请帮忙。

1 个答案:

答案 0 :(得分:0)

如果在网址末尾添加.jpg,则按预期工作。

href="http://localhost:9091/member/createCompany/getOriginalImage/1.jpg"

但我不知道为什么。

我找到了相关链接:

Fancybox urls without .jpg opens not in box
Fancybox not working with images from Twitter API

相关问题