I've got a page where I need to launch a video in a Magnific lightbox, but underneath it I'm adding a "Project Details" link, along with social media icons. It will look like this:

The plugin supports a callback:
// Initialize Magnefic Lightbox
$('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({
iframe: {
markup:
'<div class="mfp-iframe-scaler">'+
'<div class="mfp-close"></div>'+
'<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+
'</div>'+
'<div class="after-iframe">'+
'<div class="details-link"><i class="icon-link"></i> <a class="project-link" href="#">Project Details</a></div>'+
'<div>[Sharing Buttons]</div>'+
'</div>'
},
delegate: 'a',
disableOn: 700,
type: 'iframe',
mainClass: 'mfp-fade',
removalDelay: 160,
preloader: true,
fixedContentPos: false,
callbacks: {
open: function() {
// Will fire when this exact popup is opened
// this - is Magnific Popup object
initShare();
},
close: function() {
// Will fire when popup is closed
}
}
});
When I create a post loop in WordPress, I need to grab the permalink from the page and pass it to the correct instance as a unique variable. That is, unfortunately, just a bit over my head as my JS skills aren't quite where I'd like them to be. My PHP loop template (forgoing all of the variable definitions) looks like this:
<li>
<div class="overlay-box popup-vimeo">
<img itemprop="image" data-interchange="[<?php echo $img_std[0]; ?>, (default)], [<?php echo $img_retina[0]; ?>, (retina)]" alt="<?php the_title(); ?>" />
<noscript><img src="<?php echo $img_std[0]; ?>" alt="<?php the_title(); ?></noscript>
<div class="details">
<h3><?php the_title(); ?></h3>
<p><?php echo get_the_excerpt(); ?></p>
<p class="details-link mobile-only"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></p>
<p class="tiny button alignright"><i class="icon-play"></i> Play Video</p>
</div>
<a class="play-it desk-only" href="<?php echo $thisvid; ?>" title="{<?php the_title(); ?> - Watch Video}"><span></span></a>
</li>
As best I can figure, the click capture being used in this solution is going in the right direction.
Once I know how to add the callback and get the "Project Details" link to function, then I should be able to apply that same technique to pass social media links. That'll make a nice practice exercise for me once I have an initial solution.
I really, really, really need a helping hand on this first part though, as I haven't had ot do this before and my understanding of JS scopes could be much stronger than it is =/