dimsemenov / Magnific-Popup

Light and responsive lightbox script with focus on performance.
http://dimsemenov.com/plugins/magnific-popup/
MIT License
11.38k stars 3.49k forks source link

Multiple delegates, different options #318

Open renege opened 10 years ago

renege commented 10 years ago

It's not possible to use multiple delegates, with different options. Like here:

$('body').magnificPopup({
    delegate: '.magnificPopup'
});
$('body').magnificPopup({
    delegate: '.photo',
        type: 'image'
});
thinsoldier commented 10 years ago

You can set the type with a class on the actual elements in html and that will override the settings in JS. So if 90% of your items are images you would set type:image in JS and for the few things that are not images you can add class mfp-iframe or mfp-inline on those links and they will not behave as images.