How to add Facebook Like Button on preety photo

In this tutorial we learn how to add Facebook Share button on prettyphoto.

1. open your script.js file where you have call the $(‘.prettyPhoto’).prettyPhoto() initialize.

2. Go to onPictureChanged() in the $(‘.prettyPhoto’).prettyPhoto().

3. and add this code.

$(document).ready(function(){

$(‘.prettyPhoto’).prettyPhoto({
changepicturecallback: onPictureChanged,
});

function onPictureChanged() {

var fbDiv = jQuery(‘.facebook’);
fbDiv.empty();

jQuery(‘<iframe>’, {

‘src’: ‘YOUR_FACEBOOK_LIKE_SOURCE_LINK’,
‘scrolling’ : ‘no’,
‘frameborder’:’0′,
‘style’:’border=”none”‘ ,
‘overflow’:’hidden’,
‘width’:’50px’,
‘height’:’24px’ ,
‘allowTransparency’:’true’
}).appendTo(‘.pp_social’);
}

});

that is all for now.

thanks for view this post, and also keep comment, its give me energy to write this kind of useful blogs.