Note that there are some explanatory texts on larger screens.

plurals
  1. POFancybox only working sometimes without refreshing the page
    primarykey
    data
    text
    <p>I'm using Fancybox so users can click on image thumbnails and see larger images.</p> <p>The problem I'm having is that it doesn't always work when the page loads. I'll click on the thumbnails and the Fancybox doesn't show the larger images. If I refresh the page however, it works just fine. The content is generated dynamically so I wonder if I need to refresh the DOM?</p> <pre><code> &lt;script type="text/javascript"&gt; $(document).ready(function() { $(".fancybox").fancybox({ openEffect : 'fade', // openEffect / closeEffect / nextEffect / prevEffect closeEffect : 'fade', // Animation effect ('elastic', 'fade' or 'none') for each transition type nextEffect : 'fade', // String; Default value: 'fade', 'fade', 'elastic', 'elastic' prevEffect : 'fade', openSpeed : '1000', // openSpeed / closeSpeed / nextSpeed / prevSpeed closeSpeed : '1000', // The time it takes (in ms, or "slow", "normal", "fast") to complete transition nextSpeed : '1000', // Integer; Default value: 250 prevSpeed : '1000', padding : 3 }); }); &lt;/script&gt; &lt;a class='fancybox' rel='gallery' href='".$data['photo'][$x]."'&gt;&lt;img src='".$data['photo'][$y]."' style='margin-right: 2.5px; margin-left: 2.5px; vertical-align: top;'&gt;&lt;/a&gt; </code></pre> <p>When it's not working and I click on the thumbnail, here's the error that I get...</p> <p><code>TypeError: a[0] is undefined</code> in jquery.fancybox.pack.js on line 15. </p> <p>Here's how I'm calling Fancybox, maybe that's the problem?</p> <p><code>&lt;script type="text/javascript" src="/fancybox/jquery.fancybox.pack.js?v=2.1.4"&gt;&lt;/script&gt;</code></p> <p>I don't care which version of fancybox I' using as long as I get functionality here as well as on another page where I have a Fancybox that shows when the page is loaded.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload