I would like to add a 'share on facebook' button to the overlay of Fancybox 2.1.5 on instagram photographs.
At the moment I have a like button that works but that's not what I want, what I really wanted was a share button, I've tried everything and not I got it.
My code:
HTML
<script src="js/fancybox.js"></script>
<!-- ..... -->
<a class="group" rel="group1" href="https://scontent.cdninstagram.com/hphotos-xpa1/t51.2885-15/e15/10561180_1559579060958937_1557237818_n.jpg">
<img onclick="open_fancy();" src="https://scontent.cdninstagram.com/hphotos-xpa1/t51.2885-15/s150x150/e15/10561180_1559579060958937_1557237818_n.jpg"></a><br><divclass="textPhoto"><p>Qua, março 25 de 2015</p></div>
<div class="usernamePhoto">joycedoret</div>
<div class="fullNamePhoto">Joyce Doret</div>
<div class="displayVotesPhotos">1</div>
<div class="vote-button" data-numOfVotes="1" data-vote="https://scontent.cdninstagram.com/hphotos-xpa1/t51.2885-15/e15/10561180_1559579060958937_1557237818_n.jpg">Votar</div>
</div>
<div class="wrapper-image" style="position:relative;display:inline-block;">
<a class="group" rel="group1" href="https://scontent.cdninstagram.com/hphotos-xfa1/t51.2885-15/e15/11055938_789110064513812_1432468196_n.jpg">
<img onclick="open_fancy();" src="https://scontent.cdninstagram.com/hphotos-xfa1/t51.2885-15/s150x150/e15/11055938_789110064513812_1432468196_n.jpg"></a><br><divclass="textPhoto"><p>Qua, abril 01 de 2015</p></div>
<div class="usernamePhoto">rutemcaetano</div>
<div class="fullNamePhoto">Rute Caetano</div>
<div class="displayVotesPhotos">2</div>
<div class="vote-button" data-numOfVotes="2" data-vote="https://scontent.cdninstagram.com/hphotos-xfa1/t51.2885-15/e15/11055938_789110064513812_1432468196_n.jpg">Votar</div>
</div>
<!-- .... -->
JS
$(document).on('click', '.wrapper-image > a', function(){
return false;
});
function open_fancy() {
$(function() {
$("a.group").fancybox({
openEffect : 'elastic',
closeEffect : 'elastic',
beforeShow: function () {
this.title = '<br />';
this.title += '<iframe src="//www.facebook.com/plugins/like.php?href=' + this.href + '&layout=button_count&show_faces=true&width=500&action=like&font&colorscheme=light&height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:110px; height:23px;" allowTransparency="true"></iframe>';
},
helpers: {
title: {
type: 'inside'
}
}
});
});
}
Here's an example in JSFiddle with the like button.