I just create a portfolio of images with one HTML page where all the images are dynamically loaded. So far, everything is working fine, except for facebook META OG: IMAGE.
Since the page only loads once, I can assign the URL OG: IMAGE once ... But I really would like to have each picture with its own OG: IMAGE, since this is a photo album.
Photos are uploaded by clicking on -li class = "open-pic" tag. I would like to change the value of OG: IMAGE every time I click on the -li class = "open-pic" tag.
Is it possible? I found things like this:
$('meta[name=og\\:image]').attr('content', newImageUrl);
However, I do not know how to associate this with the on.click.pen-pic onclick event. Thank!
G.
source
share