Fancybox URL without .jpg does not open in field

I saw a similar question: Fancybox suffocates at the url that contains "&" And I tried all the suggested solutions, but none of them work! I included all the links correctly (jquery link first) I checked, and at the beginning of my document I declared fancybox as follows:

<script type="text/javascript"> $(document).ready(function() { $(".fancybox").fancybox({'type' : 'image'}); openEffect : 'none', closeEffect : 'none' }); }); </script> 

My code is:

  echo '<a class="fancybox" rel="group1" href="square/'.$fic_serie .'"> <img src="square/'.$fic_serie .'" alt=""/></a>'; 

$ fic_serie is a var that will be replaced by the image name

Now I feel that nothing is working; the images are too large compared to how I said that they should be (in the fancybox.js file), and when I click on them, they open as a link, not in a lightbox.

I also tried

 class='fancybox fancybox.image' 

but no luck .... Thank you!

+4
source share
1 answer

try this code

 <script type="text/javascript"> $(document).ready(function() { $(".fancybox").fancybox({ type : 'image', openEffect : 'none', closeEffect : 'none' }); }); </script> 
+22
source

Source: https://habr.com/ru/post/1499918/


All Articles