Magnific-Popup
Magnific-Popup copied to clipboard
Open Popup Gallery from single button?
I have a popup gallery working fine from a range of thumbnails, i just need a single button elsewhere on the page to open up the gallery on the first image?
Is this possible, my current method is not working..?
var gallery_popup = function() {
$('.popup_gallery').magnificPopup({
delegate: 'a',
type: 'image',
tLoading: 'Loading image #%curr%...',
mainClass: 'mfp-img-mobile',
gallery: {
enabled: true,
navigateByImgClick: true,
preload: [0,1]
},
image: {
tError: '<a href="%url%">The image #%curr%</a> could not be loaded.',
}
});
};
$('.gallery_link').click(function() {
gallery_popup.magnificPopup('open');
});
Am i missing something obvious?
i tried the basic: $('.popup-with-zoom-anim').magnificPopup({ type: 'inline', fixedContentPos: false, fixedBgPos: true,
overflowY: 'auto',
closeBtnInside: false,
preloader: false,
midClick: true,
removalDelay: 300,
mainClass: 'my-mfp-zoom-in'
});
and it works . i used this class .zoom-anim-dialog for an icon and it can popup.
without click function) show us your html5 code
I'm also looking to open a gallery with a button, can't seem to figure it out