How to Add tweet button on preetyphoto

Now we move on, how to change Tweet url 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.

function onPictureChanged() {

var twitterDiv = jQuery(‘.twitter’);
twitterDiv.empty();

4. This is important step here we gives the parameter for anchor as following

jQuery(‘<a>’, {
‘class’: ‘twitter-share-button’,
‘text’: ‘Tweet’,
‘data-url’: ‘YOUR_TWEET_URL’ , /* Here you have to write you tweet url */
‘data-count’: ‘none’,
}).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.