【发布时间】:2013-10-25 19:32:42
【问题描述】:
嗯,如标题所述,有什么方法可以阻止 Facebook js 共享器中的某些图像?
Facebook js 共享器会自动从页面中获取图像,并允许用户选择要在共享帖子中显示为缩略图的图像。目前,我们遇到了一种情况,它在页面上获取广告图像,而没有显示其他图像。
我可以想象横幅可以显示为 div 的背景图像,或者通过动态添加它们,但仍然可能存在用于排除图像的特殊标签或共享器初始化选项...在FB 文档,但它们非常“具体”...
为了澄清上述内容,请查看标记:
<!DOCTYPE html>
<html lang="en"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:og="http://ogp.me/ns#"
xmlns:fb="https://www.facebook.com/2008/fbml">
<head>
<meta property="og:image" content="/logo.jpg">
</head>
<body>
<article>
..plain text content
</article>
<aside>
<img src="/banner.jpg"> <!-- fetched image for share, wrong -->
</aside>
</body>
</html>
P.S.:我读过这个问题:how to exclude an image from facebook sharer - 但实际上动态添加横幅(选择的答案)并不是它的本意。
【问题讨论】:
标签: html facebook facebook-sharer