D
D
Denis Kiselev2017-07-24 13:18:43
JavaScript
Denis Kiselev, 2017-07-24 13:18:43

FancyBox3, how to fix error in image width and height calculations?

Hello, I'm building a website and I have a problem. The site has a gallery (at the bottom of the page), I connected the jquery FancyBox3 plugin. The gallery works, but the first image always opens very huge, when you slide to the next image, the dimensions fall into place.
What could be the problem? How to solve it?
In a loop:

<a class="fancybox" data-fancybox="gallery" href="<?php echo $gallery_item['url']; ?>" data-caption="<?php echo $gallery_item['caption']; ?>" >
     <img src="<?php echo $gallery_item['url']; ?>" alt="<?php echo $gallery_item['caption']; ?>">
</a>

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