previousSibling.style.display='block'; } el.onmouseout = function(){ this.previousSibling.style.display='none'; } } }); The images selector – $("img[data-pin='pinIt']").each –is now an array of all images for which we check the data attribute value. The rest of the code is ...
For each image with thedata-pinattribute set topinIt, we prefix it with the sharing anchor, getting the page URL directly from the pagelocationattribute, the picture URL from the imagehref, and the description from itsalttext, while properly encoding the URI components. ...