Created
September 19, 2012 05:09
-
-
Save Ollo/3747785 to your computer and use it in GitHub Desktop.
pinterest for Yahoo Stores
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
$(document).ready(function(){ | |
// get button vars | |
var site = encodeURI(window.location.href); | |
var img = $('#itemarea img').attr(encodeURI('src')); | |
var details = $('#caption #itemarea p').text(); | |
// create pin button | |
var string1 = "<a class='pin-it-button' count-layout='horizontal' href='http://pinterest.com/pin/create/button/?url="; | |
var string2 = "&media="; | |
var string3 = "&description=" + details + "'>"; | |
var string4 = "<img border='0' src='//assets.pinterest.com/images/PinExt.png' title='Pin It' /></a>"; | |
var final = "<div class='pin'>" + string1 + site + string2 + img + string3 + string4 + "</div>"; | |
// add it to the social widget | |
$('.some').prepend(final); | |
}); | |
</script> | |
</head> | |
<body> | |
<div id="caption"> | |
<div id="itemarea"> | |
<img src="https://encrypted-tbn1.google.com/images?q=tbn:ANd9GcQyOIYqv-8EhIGRoUeEMN7tWiAdE_isOdsKxOE77ugqLzPjObbD" /> | |
<p>This is a funny picture!</p> | |
<div class="some"> | |
<div>P</div> | |
<div>T</div> | |
<div>F</div> | |
</div> | |
</div> | |
<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
needs optimization and doesn't work in the editor yet but works on html