Questions tagged [magnific-popup]

Magnific Popup is a responsive lightbox & dialog script with focus on performance and providing best experience for user with any device (for jQuery or Zepto.js).

Magnific Popup is a responsive lightbox & dialog script with focus on performance and providing best experience for user with any device.

Official Site: http://dimsemenov.com/plugins/magnific-popup/


Light and modular

You can choose to include only the features that you need using the online build tool or by compiling it yourself with Grunt.js. Size of core JS file is about 3KB + each module weighs about 0.5KB (gzipped). Sass CSS preprocessor is used for easier skinning, but you're not obligated to use it.

Content is resized with CSS

The majority of lightbox plugins require you to define size of it via JS option. Magnific Popup does not - feel free to use relative units like EM's or resize lightbox with help of CSS media queries. Update content inside lightbox without worrying about how it'll resize and center.

Fast

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.

High-DPI (Retina) display support

Default controls are made with pure CSS, without external graphics. For the main image there is a built in way to provide appropriate source for different pixel density displays.

Conditional lightbox

Plugin has an option to automatically switch to alternative mobile-friendly source on small screen size. Brad Frost has a terrific article about this technique.

Memory management

Popup has an extendable micro templating engine that reuses existing DOM elements (example), which is especially useful when your popups same pattern.

733 questions
4
votes
1 answer

Flexslider with a popup Gallery

I am using flexslider for some image rotation, now there is a requirement to implement a Popup Gallery with this slide show, ie, when a user clicks on active slide inside the slider, want to show in a light box as a gallery. So I tried to…
Salih K
  • 701
  • 2
  • 12
  • 31
4
votes
1 answer

$.magnificPopup.open() callbacks is not working

$.magnificPopup.open({ items: { src: $('#cabinet-msg') }, type:'inline', midClick: true, callbacks: { close: function() { alert('test'); } } }); $.magnificPopup.open({ items: { …
webmak10
  • 479
  • 1
  • 7
  • 18
4
votes
0 answers

Magnific popup iframe closeOnBgClick does not work

There is some case when a popup shouldn't be closed by clicking the background. After googling here and there still no success on that. This is the code: jQuery('.magnific_link').magnificPopup({ type: "iframe", fixedContentPos: true, …
a1111exe
  • 641
  • 4
  • 18
4
votes
2 answers

How to display quiz using Magnific-popup with ajax

I am attempting to implement the ability to download a quiz, and display it in a lightbox, with a single mouse click. I got all the ajax stuff working, and I think am using Magnific-popup correctly, but the "lightbox" is missing. Instead all I see…
Eric Laoshi
  • 237
  • 2
  • 13
4
votes
1 answer

Is it possible to pass data via the post method to magnific popup when ajax loading content?

I'm using magnific popup and ajax loading content into it and passing values to the ajax content by appending a query string to the url, which works fine except in IE7 (and probably IE8 as well). The reason is very likely the length of the query…
Graham
  • 7,807
  • 20
  • 69
  • 114
4
votes
3 answers

What is the best way to test if a Magnific Popup is currently "open"

What is the best way to test if a Magnific Popup is currently "open"? Will a check for the existence of some div be future proof? For example, if I use: if ($(".mfp-ready").length > 0) ... I looked for the equivilent of an isopen property in the…
Graham
  • 7,807
  • 20
  • 69
  • 114
4
votes
1 answer

Can't get magnific popup to work, two javascript errors

I am trying to make a lightbox gallery and have used the example source code. Here is the documentation I read over: http://dimsemenov.com/plugins/magnific-popup/documentation.html Uncaught TypeError: undefined is not a function Uncaught…
Bowea
  • 87
  • 1
  • 2
  • 7
4
votes
1 answer

Toggle verticalFit on an open image?

I need Magnific to open up the image with verticalFit = true to start. The image is portrait aspect and needs to fit within the viewport. But if the user clicks on the image, Magnific should turn verticalFit = false so that the image expands to…
tgharold
  • 721
  • 6
  • 15
4
votes
1 answer

magnificpopup "Maxium call stack size exceeded"

I've a stackoverflow! I've tracked the source up to the setFocus and onFocusIn of the magnificpopup js file, but I cannot figure where I am generating it. Some relevant lines (in this fragment an active magnificpopup is closed and some JS (generated…
jdev
  • 96
  • 10
4
votes
0 answers

Prevent Google Docs Form Redirect on Submit

I used this method to redirect google docs forms to redirect to custom page. (source : morning.am)