A
A
aksutov19962021-08-19 17:18:14
JavaScript
aksutov1996, 2021-08-19 17:18:14

What version of jQuery do I need? Why does fancybox stop working after including jQuery?

Hello.
Tell me where I don't understand.
I'm building a website, it's made in WP based on the Astra theme. Created a child theme where I made my CSS and JS to make the site the way I want it to be. the WP constructor did not satisfy me in everything.
It's time to make the Gallery, I chose fansybox and installed it via the admin panel as an Easy FancyBox plugin (it says it's based on fansybox 1.3.4).
Installed and it doesn't work. There is an error in the console on the page where there are photos.
611e65d6c2d1b138519934.jpeg
I thought that some plugin might be interfering, I have a couple of stupid ones. Began to turn off and watch at random.
When turning off the plugin with the child theme, fansybox started working. Do not rush to think that the problem is found.
The plugin has nothing to do with it.
I turn the plugin back on, create a new child theme, i.e. clean, like the original theme, without my interference.
Fansybox works.
Conclusions, my interventions in the form of CSS and JS interfere.
Began to selectively remove my interventions here.
It worked when I removed the jQuery connection, which I needed to make my JS work.
Here is the connection:

<!-- необходимо было для работы собственного aks.js-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> 
<!-- необходимо было для работы собственного aks.js -->

So I know there are 2 more versions of jQuery. I try to connect them, but do not connect this version.
Bottom line :
My JS only works with versions 2.2.4 and 1.12.4
611e67153497c505104028.jpeg
Fancybox stops working when any of the three versions 3.6.0, 2.2.4, 1.12.4 are included.

What tell me?
I suppose there must be more solutions that I do not see from ignorance.
So far, I've only come up with a way to rewrite js without using JQuery. And remove jQuery connections.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
archelon, 2021-08-19
@archelon

Fancybox 1.3.4 is an old version. The last update was in 2010, then the version of JQuery 1.4 was relevant, I think.
Accordingly, the plugin may not be compatible with newer versions.
Maybe it's better to choose something else instead of Fancybox?
In terms of functionality, Photoswipe is closest (without dependencies).
https://ru.wordpress.org/plugins/lightbox-photoswipe/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question