-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open Popup (Image Gallery) from Link #113
Comments
Depends on how you initialized the gallery, but basically:
To open at specific index:
|
Thank you very much. |
You can view a working example on CodePen. HTML: <div class="gallery-link">
<a href="#">Open Gallery</a>
</div>
<div class="gallery">
<a href="http://farm9.staticflickr.com/8242/8558295633_f34a55c1c6_b.jpg"></a>
...
<a href="http://farm9.staticflickr.com/8225/8558295635_b1c5ce2794_b.jpg"></a>
</div> jQuery: // Bind Click Handler to Link, then Open Gallery
$('.gallery-link').on('click', function () {
$(this).next().magnificPopup('open');
});
// Initialize Magnific Popup Gallery + Options
$('.gallery').each(function () {
$(this).magnificPopup({
delegate: 'a',
gallery: {
enabled: true
},
type: 'image'
});
}); |
Hi, and thanks for this great solution. Is it possible to have animations with this kind of gallery ? I can't get http://codepen.io/dimsemenov/pen/GAIkt to work with it. |
Thank you for the great piece of code. Have an issue with $(document).ready(function () { On .magnificPopup('open') Error: Unable to get property 'items' of undefined or null reference Please help. Thank you |
First: Thank you very much for this great peace of code. One question left. Are there ways to open a gallery from a single Textlink?
Sample:
Thank you
The text was updated successfully, but these errors were encountered: