I am using fancybox 2 to display larger popup images for a series of thumbnail images. On first page load, clicking the images fails to load the fancybox popup. I see the slight blip of the loading spinner and if I open the web inspector I see the fancybox loading div for a split second before it disappears.
If I refresh the page, however, the fancybox page works just fine. This happens consistently across all pages with the same fancy box setup and occurs in both Safari and Chrome. Images are being stored on Amazon S3.
Any ideas?
//Javascript
$(function() {
return $(".fancybox").attr("rel", "gallery").fancybox({
beforeShow: function() {
return $.fancybox.wrap.bind("contextmenu", function(e) {
return false;
});
}
});
});
<!-- HTML -->
<a class="fancybox" href="/some/larger/image.jpg">
<img src="/some/thumbnail/image.jpg" />
</a>