Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fancybox urls without .jpg opens not in box

I have seen a similar question here : Fancybox chokes on a URL that contains "&" And I have tried all offered solutions but none of them work ! I have included correctly all links, ( the jquery link first ) I checked, and at the beginning of my document, I declared fancybox like this :

<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 the var that will get replaced by the image name

Right now, I feel like nothing works; the images are way too big compared to how I said they should be ( in the fancybox.js file ) and when I click on them, they open as a link, not in lightbox.

I have also tried

class='fancybox fancybox.image'

but without luck.... Thank you !

like image 889
Dikeneko Avatar asked Aug 31 '13 11:08

Dikeneko


1 Answers

try this code

<script type="text/javascript">
$(document).ready(function() {
  $(".fancybox").fancybox({
    type        : 'image',
    openEffect  : 'none',
    closeEffect : 'none'
  });
});
</script>
like image 111
JFK Avatar answered Oct 04 '22 03:10

JFK