Try this:

$.magnificPopup.open({
    items: {
        src: '<div id="test-modal" class="white-popup"><h1>Modal Test</h1><p>Test Some text.</p><p><a class="popup-modal-dismiss">Dismiss</a></p></div>',
        type:'inline'
    },
    modal: true
});

And the fiddle...

Answer from Fabricio on Stack Overflow
🌐
Dimsemenov
dimsemenov.com › plugins › magnific-popup › documentation.html
Magnific Popup Documentation
Here you can find the guide on how to use Magnific Popup. Besides this docs page, you can play with examples on CodePen.
🌐
GitHub
github.com › dimsemenov › Magnific-Popup › blob › master › website › _includes › examples.html
Magnific-Popup/website/_includes/examples.html at master · dimsemenov/Magnific-Popup
November 21, 2023 - $('.popup-modal').magnificPopup({ type: 'inline', preloader: false, focus: '#username', modal: true · }); $(document).on('click', '.popup-modal-dismiss', function (e) { e.preventDefault(); $.magnificPopup.close(); }); }); </script> </div> ·
Author   dimsemenov
🌐
Dimsemenov
dimsemenov.com › plugins › magnific-popup
Magnific Popup: Responsive jQuery Lightbox Plugin
1 — fits horizontally and vertically, 2 — only horizontally, 3 — no gaps, zoom animation, close icon in top-right corner. You may put any HTML content in each gallery item and mix content types.
🌐
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 - Here’s an example of our completed modal on Codpen: See the Pen Web Accessible Modal Window with Magnific Popup by Andrew Gehman (@AndrewGehman) on CodePen.
🌐
CodePen
codepen.io › jasoncampbell › pen › zNqZmx
On Click :: Magnific Popup Modal
<h3>Magnific Popup</h3> <a href="#" class="series-cta-btn">Magnific Popup Link</a> <pre> $(".series-cta-btn").on("click", function () { $.magnificPopup.open({ items: { src: '#seriesContainer', type: 'inline' }, closeOnContentClick: false, closeOnBgClick: true, showCloseBtn: false, enableEscapeKey: true, callbacks: { open: function () { $("html").css ({ "margin-right": 0, "overflow": "auto" }); $("#seriesContainer").fadeIn(250); } } }); }); /* MAGNIFIC POPUP EXAMPLE / CUSTOM CLOSE BUTTON ---------------------------------------------------------------------*/ $(".custom-close").click(function (event) { event.preventDefault(); $.magnificPopup.close(); }); </pre> <div id="seriesContainer"> <p>Magnific Popup Light Box</p> <a href="#" class="custom-close">X</a> </div>
🌐
CodePen
codepen.io › collection › AzzLgA
Magnific Popup Examples - a Collection by Dmytro Semenov on CodePen
A bunch of different popups, modals and lightboxes created with help of Magnific Popup plugin .
🌐
CodePen
codepen.io › onlyhouse › pen › PWEJPJ
Popup/Modal - Magnific Popup - Div content
June 23, 2024 - $('.open-popup-link').magnificPopup({ type: 'inline', midClick: true, mainClass: 'mfp-fade' }); ! 999px · Clear · Ctrl Ctrl Space Autocomplete · F Find · G Find Next · ⇧ G Find Previous · ⇧ Opt F Find & Replace · ⇧ F Format Code ...
Find elsewhere
🌐
Simmons University
web.simmons.edu › ~grovesd › comm244 › notes › week13 › magnific › magnific
How to Use Magnific | Comm244 Notes
A primary benefit of Magnific is that its modals are responsive. So, the popups will adjust to the size of the browser window.
🌐
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-popup or npm: npm install magnific-popup.
Starred by 11.4K users
Forked by 3.4K users
Languages   JavaScript 67.9% | HTML 18.5% | CSS 8.1% | SCSS 5.5%
🌐
GeeksforGeeks
geeksforgeeks.org › jquery › how-to-use-the-magnific-popup-jquery-plugin
How to Use the Magnific Popup jQuery Plugin? - GeeksforGeeks
July 15, 2025 - A button is provided, and when clicked, it opens a small popup displaying "GEEKSFORGEEKS" and "WELCOME TO GEEKSFORGEEKS". The jQuery script initializes the Magnific Popup with specific settings to manage the popup's appearance and behavior.
🌐
Okler
okler.net › forums › topic › popup-modal-magnific-popup-div-content
Popup/Modal – Magnific Popup – Div content – Okler Themes
<a class="mt-1 mb-1 popup-with-move-anim btn btn-primary" href="#small-dialog">Open with fade-slide animation</a> <!-- Dialog --> <div id="small-dialog" class="dialog dialog-sm zoom-anim-dialog mfp-hide"> <h1>Dialog example</h1> <p>This is dummy copy. It is not meant to be read.
🌐
CodePen
codepen.io › ysnoritnk › pen › NQyYJN
magnific-popup-modal
$('.popup-link-true').magnificPopup({ modal: true }); $('.popup-link-false').magnificPopup({ modal: false });
🌐
cdnjs
cdnjs.com › home › libraries › magnific-popup.js
magnific-popup.js - Libraries - cdnjs - The #1 free and open source CDN built to make life easier for developers
magnific-popup.js · Lightbox and modal dialog plugin. Can display inline HTML, iframes (YouTube video, Vimeo, Google Maps), or an image gallery. Animation effects are added with CSS3 transitions. For jQuery or Zepto. 11k · GitHub · MIT licensed · http://dimsemenov.com/plugins/magnific-popup/ Tags: lightbox, popup, modal, window, dialog, ui, gallery, slideshow, video, image, ajax, html5, animation, jquery, photo, responsive, mobile ·
🌐
CodePen
codepen.io › SitePoint › pen › Ejxvjr
Delayed Magnific Popup modal
// Popup effect with Magnific Popup // http://dimsemenov.com/plugins/magnific-popup/ function openPopup(){ $.magnificPopup.open({ items: { src: '#popup', }, mainClass: 'mfp-newspaper' }); $("button").prop("disabled", false); } $("button").on("click", function(){ setTimeout(openPopup, 2000); $(this).prop("disabled", true); });
🌐
jQuery Script
jqueryscript.net › demo › Powerful-Multi-Functional-jQuery-Lightbox-Plugin-Magnific-Popup
Magnific Popup Examples
May 6, 2022 - This is dummy copy. It is not meant to be read. It has been placed here solely to demonstrate the look and feel of finished, typeset text. Only for show. He who searches for meaning here will be sorely disappointed · Lightbox has an option to automatically focus on the first input.
🌐
JQuery
plugins.jquery.com › magnific-popup
Magnific Popup | The jQuery Plugin Registry
May 9, 2013 - Fast, light, mobile-friendly and responsive lightbox and modal dialog plugin. Open inline HTML, ajax loaded content, image, form, iframe (YouTube video, Vimeo, Google Maps), photo gallery. Animation effects added with CSS3 transitions. For jQuery or Zepto. lightbox popup modal window dialog ui gallery slideshow video image ajax html5 animation jquery photo responsive mobile
🌐
Stack Overflow
stackoverflow.com › questions › 40482047 › show-the-form-response-in-modal-window-using-magnific-popup
jquery - show the form response in modal window using Magnific Popup - Stack Overflow
It creates an <div> element that is used for modal dialog. I also added the style for this window. <html> <head> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script src="https://rawgit.com/dimsemenov/Magnific-Popup/master/dist/jquery.magnific-popup.js"></script> <script type="text/javascript"> jQuery(document).ready(function() { $(document).on('click', '.popup-modal', function (e) { $( "#indexform" ).on( "submit", function( event ) { event.preventDefault(); var formdata = $(this).serialize(); $.ajax({ type:"POST", url:"result.php", data:formdata,
🌐
npm
npmjs.com › package › magnific-popup
magnific-popup - npm
June 23, 2024 - Lightbox and modal dialog plugin. Can display inline HTML, iframes (YouTube video, Vimeo, Google Maps), or an image gallery. Animation effects are added with CSS3 transitions. For jQuery or Zepto.. 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
🌐
Stack Overflow
stackoverflow.com › questions › tagged › magnific-popup
Newest 'magnific-popup' Questions - Stack Overflow
I have thumb slider images with Magnific Popup. When I click the large image, the modal opens (Magnific Popup), and the image loads.