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
November 21, 2023 - 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
June 8, 2024 - 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?
November 21, 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 21, 2014 - 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.
🌐
Smashing Magazine
smashingmagazine.com › 2013 › 05 › truly-responsive-lightbox
Magnific Popup, A Truly Responsive Lightbox Plugin — Smashing Magazine
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:
🌐
Technical Manuals
manuals.muthu.co › posts › javascript-libraries-and-functions › magnific-popup.html
Magnific Popup - Documentation – Technical Manuals
Magnific Popup triggers several events throughout its lifecycle. You can listen for these events using jQuery’s .on() method to perform custom actions. Here are a few key events: beforeOpen: Fired before the popup opens. Useful for making last-minute modifications to the popup content or options.
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
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