开发者

Problem displaying image from url with Fancybox

开发者 https://www.devze.com 2023-04-03 08:59 出处:网络
I\'ve stored all my images in database (Mysql), but when I whant to see that image with Fancybox, it display on开发者_JAVA百科ly the binary data, not the image.

I've stored all my images in database (Mysql), but when I whant to see that image with Fancybox, it display on开发者_JAVA百科ly the binary data, not the image.

My code:

<a href="/controller/action/id" class="group" rel="fancy">
    <img src="/controller/action/id/thumb" />
</a>

For url "/controller/action/id" I use this code to return the image:

header("Content-type: {$image['Image']['image_type']}");
echo $image['Image'][ $size ];

I use CakePHP.

Thanks.


$.fancybox({
            'type':'image'
        });

This solved my problem.


Nedd to specify 'type': 'image'.

0

精彩评论

暂无评论...
验证码 换一张
取 消