How to add Google Plus share button on PrettyPhoto with twitter and facebook

just follow this step:

1.dont delete anything from jquery.prettyPhoto.js

2.Open your page and write your customize script, here

<script type=”text/javascript”>

$(document).ready(function(){
$(‘.prettyPhoto’).prettyPhoto({

});
</script>

3. this is existing script used in script.js, now we are editing this script.

<script type=”text/javascript”>

$(document).ready(function(){
$(‘.prettyPhoto’).prettyPhoto({
changepicturecallback: onPictureChanged,
});
</script>

4. and, finally do this stuff.

<script type=”text/javascript”>

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

function onPictureChanged() {

jQuery(‘.pp_social’).append(‘<g:plusone data-action=”share” href=”‘+ encodeURIComponent(location.href.replace(location.hash,””)) +'” width=”160px” ></g:plusone>’);

jQuery(‘.pp_social’).append(“<script type=’text/javascript’> \
(function() { \
var po = document.createElement(‘script’); \
po.type = ‘text/javascript’; \
po.async = true; \
po.src = ‘https://apis.google.com/js/plusone.js’; \
var s = document.getElementsByTagName(‘script’)[0]; \
s.parentNode.insertBefore(po, s); \
})(); <” + “/” + “script>”);

}
</script>

5. thats it for now.

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