Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67469

Uncaught TypeError: $(...).ekkoLightbox is not a function

$
0
0

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>

Viewing all articles
Browse latest Browse all 67469

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>