W
W
wqertAnna2019-05-20 00:07:50
JavaScript
wqertAnna, 2019-05-20 00:07:50

Why is the object I pass as the first argument when calling the fancybox method being ignored?

The site is on bitrix, there are other fancyBoxes on the page.
The entire site has the same fancyBox styles and settings.
I need another gallery on fancyBox, but somewhat different from the ones already there.
I just want to pass the configuration object I need and that's it, but for some reason it is ignored.
in other cases on the site, fancyBox is initiated like this:

<a href='/img/image.jpeg' data-fancybox="gallery">...</a>

I want to call the fancyBox method in js
<a class="gallery-pic" href="/img/image1.jpeg">картинка №1 </a>
<a  class="gallery-pic" href="/img/image2.jpeg">картинка №2 </a>

tried 2 options:
$('.gallery-pic').fancybox({
        showNavArrows: true,
        overlayShow: false
    });

In this case, fancybox works, but the object is not used for configuration, everything is the same as on other pages
Second option:
$().fancybox({
        selector : '.gallery-pic',
        showNavArrows: true,
        arrows: true,
        overlayShow: false,
    });

doesn't work at all

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question