Just add delegate: 'a' to your jquery function and make sure the img tag contains the full res image while the href contains the thumbnail.

$('.popupgallery').magnificPopup({ 
    type: 'image', 
    delegate: 'a', 
    closeOnContentClick: true, 
    image: { 
        verticalFit: false 
    } 
}); 
Answer from Saturnix on Stack Overflow
๐ŸŒ
Dimsemenov
dimsemenov.com โ€บ plugins โ€บ magnific-popup โ€บ documentation.html
Magnific Popup Documentation
The complete guide on how to use Magnific Popup - the open source responsive lightbox plugin.
๐ŸŒ
GitHub
github.com โ€บ dimsemenov โ€บ Magnific-Popup
GitHub - dimsemenov/Magnific-Popup: Light and responsive lightbox script with focus on performance. ยท GitHub
Use native <dialog> element if you need a basic dialog/modal/popup, or my PhotoSwipe library if you need an advanced image gallery. Feel free to email me if you need assistance. Fast, light and responsive lightbox plugin, for jQuery and Zepto.js. Documentation and getting started guide. Examples and plugin home page. More examples in CodePen collection. Optionally, install via Bower bower install magnific...
Starred by 11.4K users
Forked by 3.4K users
Languages ย  JavaScript 67.9% | HTML 18.5% | CSS 8.1% | SCSS 5.5%
๐ŸŒ
Dimsemenov
dimsemenov.com โ€บ plugins โ€บ magnific-popup
Magnific Popup: Responsive jQuery Lightbox Plugin
Magnific Popup displays images before they're completely loaded to take full advantage of progressive loading. For in and out transitions CSS3 is used instead of slow JavaScript animation.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ jquery โ€บ how-to-use-the-magnific-popup-jquery-plugin
How to Use the Magnific Popup jQuery Plugin? - GeeksforGeeks
July 15, 2025 - IN this approach, we have created ... and JavaScript files from CDNs. A button is provided, and when clicked, it opens a small popup displaying "GEEKSFORGEEKS" and "WELCOME TO GEEKSFORGEEKS"....
๐ŸŒ
JQuery
plugins.jquery.com โ€บ magnific-popup
Magnific Popup | The jQuery Plugin Registry
lightbox popup modal window dialog ui gallery slideshow video image ajax html5 animation jquery photo responsive mobile
๐ŸŒ
npm
npmjs.com โ€บ package โ€บ magnific-popup
magnific-popup - npm
April 28, 2016 - Latest version: 1.2.0, last published: 2 years ago. Start using magnific-popup in your project by running `npm i magnific-popup`. There are 34 other projects in the npm registry using magnific-popup.
      ยป npm install magnific-popup
    
Published ย  Jun 08, 2024
Version ย  1.2.0
Author ย  Dmytro Semenov
Find elsewhere
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ how-to-use-the-magnific-popup-jquery-plugin
How to use the Magnific Popup jQuery plugin?
January 12, 2023 - You just need to replace the HTML of showing a popup iframe video in previous example with the multiple images HTML and some jQuery code to make it a gallery. To understand it in details, see the below example. The below example will illustrate the use of magnific popup plugin to build an image ...
๐ŸŒ
ACTE
acte.in โ€บ home โ€บ magnific popup: responsive jquery | how to implement magnific popup [ overview ]
Magnific Popup : Responsive jquery | How to Implement Magnific Popup [ OverView ] | Updated 2025
How Magnific Popup jquery Article
React JS Developer Roadmap: What You Need to Learn ... Full Stack Developer vs. DevOps Engineer: Key Differences Explained ... Magnific Popup is a fast, light, mobile-friendly and responsive lightbox and modal dialog jQuery plugin. It can be used to open inline HTML, ajax loaded content, image, ... One of best Institute to learn Magnific Popup jquery from ACTE . Really impressive model where you can learn technical Skills , Soft Skill and get help to kick start your first Job as well.
Rating: 5 โ€‹
๐ŸŒ
TemplateMonster
templatemonster.com โ€บ help โ€บ js-animated-how-to-implement-jquery-magnific-popup-lightbox-plugin.html
JS Animated. How to implement jQuery "Magnific Popup" lightbox plugin - Template Monster Help
January 31, 2019 - This tutorial is going to show you how to implement the jQuery Magnific Popup lightbox plugin into your JS Animated template. JS Animated.
๐ŸŒ
Drupal
drupal.org โ€บ project โ€บ magnific_popup
Magnific Popup | Drupal.org
February 13, 2024 - Or, for the adventurous, jQuery 1.9+ is fairly stable in contrib, and most compatibility issues can be mitigated by using the jQuery Migrate library. Install the third-party Magnific Popup library as "magnific-popup" under sites/SITE/libraries (where SITE is "all," "default," etc.).
๐ŸŒ
Minddevelopmentanddesign
minddevelopmentanddesign.com โ€บ home โ€บ the mind blog โ€บ how to create a web accessible modal window with magnific popup
How to Create a Web Accessible Modal Window with Magnific Popup
August 29, 2025 - In our case, it would be the H1 tag with the ID of โ€œmodal-title.โ€ The aria-describedby attribute is assigned the ID of an element that will give more details about the element. The aria-describedby attribute is optional and really only needs to be used when there is additional information available to describe the element. The โ€˜.mfp-hideโ€™ class is part of the magnific popup styles and will hide the modal ( #mymodal ) by default.
๐ŸŒ
Technical Manuals
manuals.muthu.co โ€บ posts โ€บ javascript-libraries-and-functions โ€บ magnific-popup.html
Magnific Popup - Documentation โ€“ Technical Manuals
Magnific Popup doesnโ€™t require any specific HTML structure, but you need to select the elements that will trigger the popup using a suitable selector (e.g., class, ID). Itโ€™s recommended to use a class for consistency and easier management.
๐ŸŒ
Smashing Magazine
smashingmagazine.com โ€บ 2013 โ€บ 05 โ€บ truly-responsive-lightbox
Magnific Popup, A Truly Responsive Lightbox Plugin โ€” Smashing Magazine
December 11, 2020 - Weโ€™d know that the user would be on an old PC, which typically has a resolution of somewhere between 800 ร— 600 and 1280 ร— 1024 pixels; so, we can just set a fixed margin from the top: .lightbox-image { margin-top: 10%; }. Alternatively, instead of opening the lightbox, you can just link directly to the content. In Magnific Popup, you can do this like so:
Top answer
1 of 2
1

I had the same problem, and had the same setup as you. I thought I had called the jQuery library already, but apparently not, because as soon as I added the code (below) before closing my HEAD, everything started working! I know this answer is about a year belated, but maybe it will help others in the future.

<script type="text/javascript" 
        src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
2 of 2
0

I had this same issue and took me a while to figure it out, so thought I would share. You have to load the .js files in proper sequence or it will not work.

    <!DOCTYPE html>
    <html lang="">

    <head>
    <title>Gallery</title>
    <meta charset="utf-8">
    <link href="../styles/magnific-popup.css" rel="stylesheet" type="text/css" media="all"> 
    </head>
    
    <body id="top">
    
    <!-- JAVASCRIPTS -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script src="../scripts/jquery.min.js"></script>
    <script src="../scripts/jquery.magnific-popup.js"></script>
    
    <div class="popup-gallery">
        <a href="http://farm9.staticflickr.com/8242/8558295633_f34a55c1c6_b.jpg" title="The Cleaner"><img src="http://farm9.staticflickr.com/8242/8558295633_f34a55c1c6_s.jpg" width="75" height="75"></a>
        <a href="http://farm9.staticflickr.com/8382/8558295631_0f56c1284f_b.jpg" title="Winter Dance"><img src="http://farm9.staticflickr.com/8382/8558295631_0f56c1284f_s.jpg" width="75" height="75"></a>
        <a href="http://farm9.staticflickr.com/8225/8558295635_b1c5ce2794_b.jpg" title="The Uninvited Guest"><img src="http://farm9.staticflickr.com/8225/8558295635_b1c5ce2794_s.jpg" width="75" height="75"></a>
        <a href="http://farm9.staticflickr.com/8383/8563475581_df05e9906d_b.jpg" title="Oh no, not again!"><img src="http://farm9.staticflickr.com/8383/8563475581_df05e9906d_s.jpg" width="75" height="75"></a>
        <a href="http://farm9.staticflickr.com/8235/8559402846_8b7f82e05d_b.jpg" title="Swan Lake"><img src="http://farm9.staticflickr.com/8235/8559402846_8b7f82e05d_s.jpg" width="75" height="75"></a>
        <a href="http://farm9.staticflickr.com/8235/8558295467_e89e95e05a_b.jpg" title="The Shake"><img src="http://farm9.staticflickr.com/8235/8558295467_e89e95e05a_s.jpg" width="75" height="75"></a>
        <a href="http://farm9.staticflickr.com/8378/8559402848_9fcd90d20b_b.jpg" title="Who's that, mommy?"><img src="http://farm9.staticflickr.com/8378/8559402848_9fcd90d20b_s.jpg" width="75" height="75"></a>
    </div>
    
    <script type="text/javascript">
          $(document).ready(function() {
            $('.popup-gallery').magnificPopup({
              delegate: 'a',
              type: 'image',
              tLoading: 'Loading image #%curr%...',
              mainClass: 'mfp-img-mobile',
              gallery: {
                enabled: true,
                navigateByImgClick: true,
                preload: [0,1] // Will preload 0 - before current, and 1 after the current image
              },
              image: {
                tError: '<a href="%url%">The image #%curr%</a> could not be loaded.',
                titleSrc: function(item) {
                  return item.el.attr('title') + '<small>by Marsel Van Oosten</small>';
                }
              }
            });
          });
        </script>
    
    </body>
    </html>
๐ŸŒ
Uxthemes
docs.uxthemes.com โ€บ ux themes docs โ€บ flatsome โ€บ magnific popup
Magnific Popup - UX Themes Docs
March 22, 2023 - Examples using this library to implement and use custom-coded popups (a library that comes within the theme and is lazy loaded) Ensure that dependencies are cor