fancyapps / ui

A library of JavaScript UI components, includes the best lightbox - Fancybox5
https://fancyapps.com/
Other
785 stars 98 forks source link

Can't use fancybox #604

Closed hunli12312 closed 8 months ago

hunli12312 commented 8 months ago

Describe the bug

I am creating the website for my django project.

In the html file, I wrote

                    <div class="portfolio-item image-zoom">
                        <div class="image-zoom-wrapper">
                            <img src="{% static 'images/bullet.png' %}">
                        </div>
                        <a href="{% static 'images/bullet.png' %}" data-fancybox="gallery" class="iconbox"><i class="ri-search-2-line"></i></a>
                    </div>

No matter how hard I tried, I just couldn't use fancybox. I have no clue. Is that because the path?

 href="{% static 'images/bullet.png' %}

Reproduction

Just adding data-fancybox="gallery". Then nothing happened.

Additional context

No response

fancyapps commented 8 months ago

Hi,

Simply follow the docs - https://fancyapps.com/fancybox/getting-started/#option-1-declarative

Unlike previous versions, you have to call Fancybox.bind() method to enable Fancybox.

Other than this, I don't know what else to comment without seeing your live page/demo.