I would like the opened image to have the attribute data-pin="true"
.
Here is what I want the html of the opened image to look like:
<img data-pin="true" class="fancybox-image" src="/uploads/gallery_item/image/426/full_ExShow2013_3156.jpg#lightbox0" alt="" >
Here is the JS I have that isn't working:
$('.fancybox').fancybox({
beforeLoad: function(){
$(this.element).data("pin", "true")
}
});
EDIT
HTML of the thumbnail images:
<a class="fancybox" href="/uploads/gallery_item/image/426/full_example.jpg" rel="gallery">
<img alt="" data-src="/uploads/gallery_item/image/426/example.jpg" src="/uploads/gallery_item/image/426/example.jpg" style="width: 301px; height: 301px;"></div>
</a>