I'm trying to get Magnific Popup to work for me, and I'm having difficulty with it. I'm a little new when it comes to Javascript and JQuery. I have been looking through the documentation for several days (literally) and am looking through stackoverflow. I found a few answers, but it seems that what I want does not suit me.
What I want to do is show the gallery using thumbnails inside multiple divs that have some style. It is preferable that the long description be hidden until the gallery is opened by clicking on individual elements of the gallery. Then display a long description to the right (float on the right) mfp-imag (which I will float to the left).
HTML
<div class="fourColumns">
<div class="fourColumnsHeader">
Image Title<br>
<a class="with_caption" title="This is the Caption" href="/images/image.jpg"><img src="/images/image.jpg" alt="Image" width="223" height="131"></a>
<div>
This is one long discription<br>
This is some more detail...<br><br>
- Bullet<br>
- Bullet<br>
- Bullet
</div>
</div>
</div>
<div class="fourColumns">
...
</div>
<div class="fourColumns">
...
</div>
<div class="fourColumns">
...
</div>
I think I need something like this Javascript
<script type="text/javascript">
$('.fourColumns').magnificPopup({
delegate: 'a',
type: 'image',
gallery: {enabled: true},
image: {
markup: '<div class="mfp-figure">'+
'<div class="mfp-close"></div>'+
'<div class="mfp-img"></div>'+
'<div class="mfp-description"></div>'+
'<div class="mfp-bottom-bar">'+
'<div class="mfp-title"></div>'+
'<div class="mfp-counter"></div>'+
'</div>'+
'</div>',
cursor: 'mfp-zoom-out-cur',
tError: '<a href="%url%">The image</a> could not be loaded.'
},
preloader: true,
callbacks: {
elementParse: function(item) {
var imgCaption = item.el.find('p');
item.content.find('.mfp-description').html(imgCaption);
},
}
});
</script>
, . . !:)