I’ve been trying to get fancybox 2 to work for ages.
Eventually I’ve gotten to the point of just trying a basic example on jsfiddle.
I call fancybox via:
$(document).ready(function() {
$(".fancybox").fancybox();
});
and the html looks like:
<a class="fancybox" rel="group" href="http://lorempixel.com/1000/500/"><img src="http://lorempixel.com/500/250/" alt="" /></a>
The code is taken from fancybox’s own site, just grabbing some placeholder images from lorempixel.
I’ve attached the to the fiddle the required fancybox css and js, and told it to use jquery 1.7.2
Could someone please take a look and let me know where I’m going wrong? It’s driving me crazy that I can’t even get the basic example to work.
Thanks!
<Update>
As JFK stated in his answer, the problem is that fancybox could not determine the content type because there is no extension on the lorempixel-url.
</Update>
Phew, took me quite a long time to figure this out. The problem is indeed the “lorempixel.com” service. I have updated the fiddle to a “real” image and voilà ;).
http://jsfiddle.net/mnuRw/3/