我有以下代码:
$(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="" />
单击图像时按预期工作:
如果像这样改写身体:
<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="" />
点击图片后,我看到以下结果:
答案 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