在这个链接中,我学会了为 Google +1 按钮指定一个 URL。
specify custom url to gplus one button .
我还可以指定特定图片吗?
已编辑
我不需要更改 Google 加号按钮 gif 或 Google 加号按钮的背景。我需要指定用户想要在社交网络中分享的图像。
可能吗?
最佳答案
是的,这是可能的。
您的意思是您想要指定一张图片,该图片将显示在通过在 Google+ 上分享而生成的代码段中。 +1 按钮有两个作用:1) 点击后会在计数中添加 +1,以及 2) 用户可以选择将您的网址分享到 Google+ 并对其发表评论。
您要问的是该交互的第二部分,记录在 https://developers.google.com/+/plugins/snippet/ 中
该页面有一个工具可以帮助您生成需要插入到页面中的 HTML。您还可以选择三种不同的方法来指定片段信息。
使用 schema.org 标记的示例:
<!-- Update your html tag to include the itemscope and itemtype attributes. -->
<html itemscope itemtype="http://schema.org/Article">
<!-- Add the following three tags inside head. -->
<meta itemprop="name" content="My Cool Article">
<meta itemprop="description" content="This is the greatest site ever">
<meta itemprop="image" content="http://example.com/mycoolimage.png">
关于javascript - 从 Google +1 按钮共享时指定图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13307146/