L
L
L1nw0od2019-09-23 19:05:45
JavaScript
L1nw0od, 2019-09-23 19:05:45

Why can't I loop the fancybox gallery?

I'm using a fancibox gallery, but I can't loop it.

<script>
$(document).ready(function() {
  $("[data-fancybox]").fancybox({
 loop: true
  });
});
    </script>

Maybe some syntax errors?
<div class="grid grid__certificates">
                        <div class="grid-item">
                            <a data-fancybox="gallery" href="img/gallery/1.png">
                                <img class="img-responsive" src="img/gallery/1.png" alt="">
                            </a>
                        </div>
                        <div class="grid-item">
                            <a data-fancybox="gallery" href="img/gallery/2.png">
                                <img class="img-responsive" src="img/gallery/2.png" alt="">
                            </a>
                        </div>

                        <div class="grid-item hidden-sm">
                            <a data-fancybox="gallery" href="img/gallery/3.png">
                                <img class="img-responsive" src="img/gallery/3.png" alt="" style="margin-bottom: 9px;">
                            </a>

                            <a data-fancybox="gallery" href="img/gallery/4.png" class="hidden-xs hidden-sm">
                                <img class="img-responsive" src="img/gallery/4.png" alt="">
                            </a>
                        </div>
                        <div class="grid-item visible-xs-block ">
                            <a data-fancybox="gallery" href="img/gallery/4.png">
                                <img class="img-responsive" src="img/gallery/4.png" alt="">
                            </a>
                        </div>
                    </div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aleksandr Yurchenko, 2019-09-23
@yaleksandr89

Check the console, connected according to the instructions from the off site.
Inserted your markup and the script - it works.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question