infinite scroll and fancybox

Skip to first unread message

Nov 2, 2017, 7:28:11 AM11/2/17
to FancyBox

Good morning,
 I have a problem with fancybox and infinite scroll. When my page load new contents, fancybox don't open it.
This is my code:

sub funzione1()
for i=1 to 4
response.write "<a href=""img/test"& i &".jpg"" data-fancybox=""images 1"" class=""imglink""><img src=""img/test"& i &".jpg"" style=""width:40%;""></a>"
response.write "*************************************************************************************************************************************************************"
end sub

<link rel="stylesheet" type="text/css" href="/fancybox-3.0/dist/jquery.fancybox.min.css">
<div id="contentsWrapper" >
<div class="content">
call funzione1()
<a href="testscroll.asp" id="next">NEXT</a>
<script src="//"></script>
<script src="/js/jquery.clever-infinite-scroll.js"></script>
    contentsWrapperSelector: '#contentsWrapper',
    contentSelector: '.content',
    nextSelector: '#next',
    loadImage: 'ajax-loader.gif'
<!-- FANCYBOX -->
  <script src="/fancybox-3.0/dist/jquery.fancybox.js"></script>
      thumbs : {
        showOnStart : true

This is a test page where I load always 4 photo. After the first called, fancybox don't open next photos.
The message error is:
jquery-2.1.4.min.js:2 Uncaught Error: Syntax error, unrecognized expression: [data-fancybox=images 1]
    at (jquery-2.1.4.min.js:2)
    at ga.tokenize (jquery-2.1.4.min.js:2)
    at (jquery-2.1.4.min.js:2)
    at [as find] (jquery-2.1.4.min.js:2)
    at n.fn.init.find (jquery-2.1.4.min.js:2)
    at new n.fn.init (jquery-2.1.4.min.js:2)
    at n (jquery-2.1.4.min.js:2)
    at HTMLAnchorElement._run (jquery.fancybox.js:2632)
    at HTMLDocument.dispatch (jquery-2.1.4.min.js:3)
    at HTMLDocument.r.handle (jquery-2.1.4.min.js:3)

Sorry for my bad english.

Thanks for the help

Reply all
Reply to author
0 new messages