How To Create A Custom Pinterest “Pin It” Button For Your Website
Libby Fisher came up with this nice code snippet and shared it on ICode4You, which I thought would also be worth sharing here on Blogfreakz. It’s a JavaScript code that lets you create a “Pin It” button using a custom graphic for your website. Copy it and enjoy sharing your favorite images in Pinterest!
<div>
<a href=”javascript:void((function(){var%20e=document.createElement(‘script’); e.setAttribute(‘type’,'text/javascript’); e.setAttribute(‘charset’,'UTF-8′); e.setAttribute(‘src’,’http://assets.pinterest.com/js/pinmarklet.js?r=’+Math.random()*99999999);document.body.appendChild(e)})());”> <img src=”images/pinit.jpg” alt=”Pin It” /></a>
</div>
Be sure that you change the path to the image in the code above so that it will point to the graphic that you want to use for the “Pin It” button. Also, you can substitute the text for the graphic if you want.
1 Comment
Lakshmi Balu
08.14.2012
That code is a real goody I think. You have made it so easy for the non coders. Thanks a ton!
There are no trackbacks to display at this time.