Im trying to use ekkolightbox on my wordpress site but every time I select an image I get the response.
Uncaught TypeError: $(...).ekkoLightbox is not a function
My guess was that I wasn't importing the library properly through cdn, But I cant quite figure out what I did wrong.
Here is a shortened version of my code.
<head><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/ekko-lightbox/5.3.0/ekko-lightbox.js"></script></head><body><div class="col-md-4"><a href="https://unsplash.it/1200/768.jpg?image=251" data-toggle="lightbox" data-gallery="example-gallery" data-type="image"><img src="https://unsplash.it/600.jpg?image=251" class="img-fluid"></a></div><script type="text/javascript">
jQuery(document).ready(function( $ ) {
$(document).on('click', '[data-toggle="lightbox"]', function(event) {
//alert("clicked"); //to test this function ran
event.preventDefault();
$(this).ekkoLightbox();
});
});</script></body>