Dimsemenov
dimsemenov.com › plugins › magnific-popup › documentation.html
Magnific Popup Documentation
Play with this example on CodePen. By default, Magnific Popup has four types of content: image, iframe, inline, and ajax.
CodePen
codepen.io › TheSagarMahajan › pen › rxMjKd
magnific popup
<html> <head> <script src="https://code.jquery.com/jquery-3.1.0.js"></script> </head> <body> <div class="magnific_popup"> <div id="popup_container"> <p id="closer">X</p> <p id="title">The Magnific Popup</p> </div> </div> <button onclick="popup()" id="sagbutton">Magnific Popup</button> </body> </html>
CodePen
codepen.io › hows › pen › vZjXWM
[magnific-popup]AjaxPractice
$(document).ready(function(e) { //init goods_popup('.ajax-link','#goods_preview' ); $.extend(true, $.magnificPopup.defaults, { tClose: '關閉', tLoading: 'Loading...', ajax: { tError: '沒有成功載入,可能是該資訊已不存在。<a href="index.html">點擊此處返回</a>' } }); }); ; (function($) { window.goods_popup = function(triggerBtn, findtarget){ $(triggerBtn).magnificPopup({ preloader: true, removalDelay: 300, type: 'ajax', callbacks: { beforeClose: function() { $(findtarget).removeClass('popup-show').addClass('popup-close'); }, close: function() { $(findtarget).removeClass(
CodePen
codepen.io › elethompson › pen › pjOxmJ
Magnific Popup Demo
<div class="parent-container"> <a href="https://lorempixel.com/400/200/cats/1">Open popup 1</a> <a href="https://lorempixel.com/400/200/cats/2">Open popup 2</a> <a href="https://lorempixel.com/400/200/cats/3">Open popup 3</a> </div> <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.0.0/jquery.magnific-popup.min.js"></script>
CodePen
codepen.io › egmashraful › pen › NJeVap
Magnific Popup Youtube Video
<!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <title></title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/magnific-popup.min.css"> </head> <body> <div class="container"> <a href="https://www.youtube.com/watch?v=Cpmw25cSYow" class="youtube">Hello</a> </div> <script src="http://code.jquery.com/jquery-3.3.1.min.js"></script> <!-- Magnific Popup core JS file --> <script src="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.min.js"></script> </body> </html>
Dimsemenov
dimsemenov.com › plugins › magnific-popup
Magnific Popup: Responsive jQuery Lightbox Plugin
You have full control of what is displayed in popup, align it to any side via CSS, enable or disable scroll on right side of window - whatever. Load content via ajax Load another content via ajax
GitHub
github.com › dimsemenov › Magnific-Popup › issues › 920
Nested popups with AJAX · Issue #920 · dimsemenov/Magnific-Popup
When I add closeOnContentClick: false the popups would not close on content click anymore, but the second popup now opens behind the first popup. How can I fix this? My code is simple, I am not trying to do anything fancy. $('.cpo-history, .cpo-history-add').magnificPopup({ type:'ajax', closeOnContentClick: false, closeOnBgClick: false, closeBtnInside:true });
GitHub
github.com › dimsemenov › Magnific-Popup › blob › master › website › _includes › examples.html
Magnific-Popup/website/_includes/examples.html at master · dimsemenov/Magnific-Popup
<a class="simple-ajax-popup" href="site-assets/ajax/test-ajax-2.html" >Load another content via ajax</a>
Author dimsemenov
GitHub
github.com › dimsemenov › Magnific-Popup › issues › 985
Use Magnific Popup with AJAX-loaded content · Issue #985 · dimsemenov/Magnific-Popup
Magnific doesn't work with that content because the event listeners fire on page load, but the the AJAX-loaded content is not yet inserted in the page at that point. The only workaround for this that I know of is to use inline javascript on the AJAX-loaded content. I tried to do something like: <a class="test-popup-link" href="path-to-image.jpg" onclick="magnificPopup({type: 'image'}).magnificPopup('open');">Open popup</a>
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%
Top answer 1 of 4
2
$('.external-media').click(function( event ) {
event.preventDefault();
var items = [];
$.ajax({
url: jQuery(this).attr('href'),
type:'GET',
success: function(data){
$(data).find('.slide').each(function() {
items.push({
src: $(this).attr("src"),
title: $(this).attr("alt")
});
});
},
complete: function() {
$.magnificPopup.open({
items: items,
type: 'image',
gallery: { enabled: true }
});
}
});
});
2 of 4
1
I don't see items: in your script.
$('.open-gallery-link').click(function() {
/*an items array that will get passed to the popup*/
var items = [];
$( $(this).attr('href') ).find('.slide').each(function() {
items.push( {
src: $(this)
} );
});
$.magnificPopup.open({
items:items,
gallery: {
enabled: true
}
});
});
For multiple instances:
$('.first-popup-link, .second-popup-link').magnificPopup({
closeBtnInside:true
});
many more examples are here
GitHub
github.com › dimsemenov › Magnific-Popup › blob › master › website › documentation.md
Magnific-Popup/website/documentation.md at master · dimsemenov/Magnific-Popup
Play with this example on CodePen. By default, Magnific Popup has four types of content: image, iframe, inline, and ajax.
Author dimsemenov
JQuery
plugins.jquery.com › magnific-popup
Magnific Popup | The jQuery Plugin Registry
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