Closed tuzibixia closed 3 years ago
I am getting the same error. I was following directions on using lightgallery with lightslider. jquery version: "3.4.1" my code:
require('lightslider')
require('lightgallery')
...
$('#imageGallery').lightSlider({
gallery:false,
item:4,
loop:true,
thumbItem:9,
slideMargin:0,
enableDrag: false,
currentPagerPosition:'left',
onSliderLoad: function(el) {
el.lightGallery({
selector: '#imageGallery .lslide'
});
}
});
UPDATE: when included the src/js/lightgallery.js file, it worked. I should add, that I am using webpack.
I am currently having the same issue:
$(…).lightGallery is not a function
Using the lightGallery inside a vue.js project like so:
import {ImageGallery} from './image_gallery';
require('lightgallery/dist/js/lightgallery.js'); // require('lightgallery'); // also tried this
class App { constructor() { this.imageGallery = new ImageGallery(); } }
2. Inside _image_gallery.js_:
... initLightgallery(container) { let $lg = $(container); $lg.lightGallery({ selector: 'figure.lightbox-trigger', mode: 'lg-fade', download: false, speed: 500, subHtmlSelectorRelative: true }); }
**Additional information:**
- Node: v12.13.1
- Npm: 6.13.7
- jQuery: 3.4.1
- Bootstrap: 4.3.1
- OS: Windows 10
- Browser: Chrome
I'm getting the same issue. Injected straight into a custom Wordpress plugin using cdnjs.com links. It works perfect on jQuery 1.12.4 but fails to load on jQuery 3.4.1
I have the same issue and I fixed it like this way
import 'lightgallery';
This issue has been automatically marked as stale because it has not had recent activity. If the issue is still valid for version 2.x, please re-open. Apologize for not responding on time. Thank you for your contributions.
Describe the bug Sorry! I already know this errorMsg is not a bug, but I want to know If the old site has more than 1 jQuery version there. Though I can't touch that I still want to use this beautiful framework, how can I do with it.
To Reproduce Steps to reproduce the behavior:
$(...).lightGallery is not a function.
And the framework doesn't work.Expected behavior I want to use lightGallery under different jQuery versions, can I choose which jQ version the lightGallery function is bund by ?
Screenshots
Desktop (please complete the following information):