Catalunya's Son
Catalunya's Son

Reputation: 65

How to load image from URL into shadow-box?

I'm using shadow-box to display images in my project, I did the integration for the css and js files and called the function:

<link rel="stylesheet" type="text/css" href="../../libraries/shadowbox-3.0.3/shadowbox.css">
<script type="text/javascript" src="../../libraries/shadowbox-3.0.3/shadowbox.js"></script>
<script type="text/javascript">
    Shadowbox.init();
</script>

here are the codes to get the src attribute and wrap the images by links with rel='shadowbox'

$('#display_article #core_art').each(function(){
        var src = $(this).find('img').attr('src');
        $(this).find('img').wrap("<a href='"+ src +"' rel='shadowbox'></a>");
    });

the problem is, when I click on the image, shadowbox is appear, but the image does not. what seems to be the problem ?

Upvotes: 0

Views: 401

Answers (0)

Related Questions