M
M
Mister88912015-09-25 11:56:05
JavaScript
Mister8891, 2015-09-25 11:56:05

jquery gallery jquery.lightbox-0.5.js not working on server. How to run it?

I hook up the gallery with this script
jQuery(function(){
jQuery(".gallery").lightBox({
fixedNavigation: true
});
});
When I click on an image, it does not open in a modal window, but on a new page.
Although when I launch a page with a gallery, everything just works in the browser. And on yii2 in the console it gives this error
Uncaught TypeError: $(...).lightBox is not a function

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Q
qazomardok, 2015-10-01
@Mister8891

1. Check the order in which the script is loaded - you may be calling a function when it hasn't loaded yet. (probably this)
2. Check which version of jquery is required for your script, and which one it costs.
3. Try replacing all "$" with "jQuery" (be careful not to mess up the syntax), or google jQuery noconflict

M
MetaDone, 2015-09-25
@MetaDone

Check which path in the script file was generated, it is likely that it does not correspond to the real location of the file

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question