Show Pinterest hover buttons only on images with specified class

So, one way of doing it in jQuery would be to set all images, by default, to have the attribute:

data-pin-no-hover="true"

The jQuery for this would simply be:

 $("img").attr("data-pin-no-hover", true);

Then below that you could have an additional line changing the value to false for the specific class you want to remove the attribute:

$(".pinit_img").removeAttr("data-pin-no-hover");

Sorry for answering my own question but this is how I overcome the problem. I just wrote some JavaScript that looks for images with the class "pinthis" and applies the attribute nopin="true" to everything else.

I won't tick this answer just yet because there may be an official way to do this without having to apply nopin="true" to everything.. but it's seeming less and less likely.

Personally this is a bit of a disappointment on Pinterest's part because surely you should be telling only the items you do want to have it rather than using wasteful time iterating through all the items that don't want it. It just seems like wasteful markup to me.

Anyway, this is how I done it:

<script type="text/javascript">
    $(document).ready(function(){
        $("img").each(function(){
            if(!$(this).hasClass("pinthis")){
                $(this).attr("nopin", "true");
            }
        });
    });
</script>