fancyapps/fancyBox — Issue #151: Facebook LIKE helper for gallery images?
Author: neokio
Created: 2012-02-16 03:34:06+00:00
State: open

I want to add the Facebook LIKE button to the bottom right corner of my fancyBox gallery popups.

Below is my first (and unsuccessful) attempt at writing a helper for this ...
I'd be most grateful if someone could show me how to get this working :)

/*
* fancyBox Facebook helper
*
* Usage:
* $('.fancybox').fancybox({
* facebook: {
* url : 'http://www.blah.com/blah'
* }
* });
*/
(function ($) {
$.fancybox.helpers.facebook = {
facebook: {},
afterShow: function (opts) {
var facebook;
var tpl = '

';
this.facebook = $(tpl).appendTo('body');
facebook = this.facebook;
},
beforeClose: function () {
this.facebook = {};
}
};
}(jQuery));