0

I have spent the last two hours trying to get fancybox to work for me with no avail. I searched this forum as well, but nothing helps. I'm hoping that someone will be able to help me.

Here are the links:

<link href="/css/bootstrap.css" media="screen" rel="stylesheet" type="text/css" >
<link href="/css/main.css" media="screen" rel="stylesheet" type="text/css" >
<link href="/css/jquery.fancybox.css" media="screen" rel="stylesheet" type="text/css" >
<script type="text/javascript" src="/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.js"></script>
<script type="text/javascript" src="/js/jquery.fancybox.js"></script>
<script type="text/javascript" src="/js/jquery.fancybox.pack.js"></script> 

Here is the code:

<script type="text/javascript">
$(document).ready(function() {
   $('.fancybox').fancybox(); 
});

But the following doesn't work, the image opens in a new page:

<a href="/index.php/files/showimage/id/80" class="fancybox" title="View Image">
<img src="/img/icons/image.png" alt="Member Image" /></a>

I don't get any errors when using the Firebug console. I'm using Firefox, but it doesn't work in Chrome and Safari either. Thanks in advance.

user4567
  • 11
  • 3
  • Does `/index.php/files/showimage/id/80` return an image? – Boaz Mar 27 '14 at 21:37
  • Thanks Boaz. Yes, it returns an image, but it seems that fancybox doesn't handle images returned dynamically through PHP. I had no problems getting it to work with a static image. I'm going to use the bootstrap modal instead. – user4567 Mar 27 '14 at 21:50
  • If you've solved the issue, you should answer your own question then and provide the detailed solution for the sake of others. – Boaz Mar 27 '14 at 22:18
  • 1
    First, you only need either fancybox.js or fancybox.pack.js but not both. Second, check http://fancyapps.com/fancybox/#support FAQ tab No. 5 – JFK Mar 28 '14 at 00:03
  • possible duplicate of [Fancybox links don't show in lightbox - what am i missing?](http://stackoverflow.com/questions/17554068/fancybox-links-dont-show-in-lightbox-what-am-i-missing) – JFK Mar 28 '14 at 00:05

0 Answers0