Reputation: 384
The image keeps on disappearing after the image is clicked.
HTML
<div class="container">
<section id="picture-container">
<div class="picture-box">
<a href="gallery/img1.JPG" class="fancybox" rel="group"><img src="gallery/small-images/img1.JPG"></a>
</div>
<div class="picture-box">
<a href="gallery/img2.JPG" class="fancybox" rel="group"><img src="gallery/small-images/img2.JPG"></a>
</div>
</section>
</div> <!-- /container -->
JavaScript
<script src="scripts/jquery.fancybox.js"></script>
<script type="text/javascript" src="/scripts/helpers/jquery.fancybox-buttons.js?v=1.0.5"></script>
<script type="text/javascript" src="/scripts/helpers/jquery.fancybox-media.js?v=1.0.5"></script>
<link rel="stylesheet" href="/scripts/helpers/jquery.fancybox-thumbs.css?v=1.0.7" type="text/css" media="screen" />
<script type="text/javascript" src="/scripts/helpers/jquery.fancybox-thumbs.js?v=1.0.7"></script>
<script>
$(document).ready(function() {
context = $('#picture-container');
$("a.fancybox", context).fancybox();
});
</script>
Upvotes: 3
Views: 2533
Reputation: 108
How it was answered (2014), in this link here in Stack:
Thumbnails disappears after click on them, FancyBox
Set the href
like the src
in img
:
<a class="fancybox" href="image_source" data-fancybox-group="gallery" title=""><img src="image_source" alt="" /></a>
Upvotes: 0