Skip to content Skip to sidebar Skip to footer

Typeerror: $(...).magnificpopup Is Not A Function

I'm on chrome developer edition. The library is not loaded and I can't figure out why. The error is reported in the chrome console. This is my code:

Solution 1:

You may not have included the JQuery library in your code. Remember that the JQuery file must be placed above all other Javascript code.

Solution 2:

$(document).ready(function ($) {
    $('.test-popup-link').magnificPopup({
    type: 'image',
    gallery: {
            enabled: true,
            navigateByImgClick: true,
            preload: [0,1] // Will preload 0 - before current, and 1 after the current image
          }
    // other options
  });
  });

just pass $ in $(document).ready(function ($) and it will be start working

Solution 3:

I just got exactly the same problem today: magnificPopup did work fine since weeks. And suddenly I'm getting the same "magnificPopup is not a function" error.

Adding the $ into line (document).ready(function ($) { fixed the problem for me, but I'm still wondering why (just like Rick above).

Even the documentation at https://dimsemenov.com/plugins/magnific-popup/documentation.html still says, the call goes like this:

$(document).ready(function() {
  $('.image-link').magnificPopup({type:'image'});
});

Post a Comment for "Typeerror: $(...).magnificpopup Is Not A Function"