Desaparece la imagen de Fancybox

The image keeps on disappearing after the image is clicked.


<div class="container">
    <section id="picture-container">
        <div class="picture-box">
            <a href="gallery/img1.JPG" class="fancybox" rel="group"><img src="gallery/small-images/img1.JPG"></a>
        <div class="picture-box">
            <a href="gallery/img2.JPG" class="fancybox" rel="group"><img src="gallery/small-images/img2.JPG"></a>
</div> <!-- /container -->


<script src="scripts/jquery.fancybox.js"></script>
<script type="text/javascript" src="/scripts/helpers/jquery.fancybox-buttons.js?v=1.0.5"></script>
<script type="text/javascript" src="/scripts/helpers/jquery.fancybox-media.js?v=1.0.5"></script>
<link rel="stylesheet" href="/es/scripts/helpers/jquery.fancybox-thumbs.css?v=1.0.7" type="text/css" media="screen" />
<script type="text/javascript" src="/scripts/helpers/jquery.fancybox-thumbs.js?v=1.0.7"></script>

    $(document).ready(function() {
        context = $('#picture-container');
        $("a.fancybox", context).fancybox();

preguntado el 05 de mayo de 13 a las 15:05

Solved it myself : ' #picture-container img { display: block !important; }' After each click the image would go to display: none. That's the solution. -

It would have been easier just binding fancybox without any context like $("a.fancybox").fancybox(); ... see your code working .... why over-complicating things? -

Would that be easier to find the class i.e. by using contexts? -

1 Respuestas

How it was answered (2014), in this link here in Stack:

Thumbnails disappears after click on them, FancyBox

Seleccione las href como el src in img:

<a class="fancybox" href="image_source" data-fancybox-group="gallery" title=""><img src="image_source" alt="" /></a>

respondido 07 mar '22, 16:03

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.