自定义AddThis按钮图标图形

时间:2012-03-07 16:47:00

标签: javascript html social addthis

我有一堆AddThis分享按钮,在有人订阅我的电子邮件列表后显示。

我想为Google Plus添加一个分享按钮,但它不起作用。

例如,要放置我自己的LinkedIn按钮,我使用以下内容,它就像一个魅力:

<a class="addthis_button_linkedin"><img src="img/linkedin.png" width="64" height="64" alt="Share to LinkedIn"></a>

但是,当我为自定义Google+按钮执行相同操作时,会出现两个按钮。这是我的标记:

<a class="addthis_button_google_plusone"><img src="img/googleplus.png" width="64" height="64" alt="Share to Google+"></a>

以下是图片:http://goo.gl/9lILs

之前是否有人遇到此问题? AddThis支持论坛没有回复。

如果API不支持,有没有办法攻击某些东西?就像隐藏大图片背后的小图片一样?

[edit]我可以使用css移动其他图标来覆盖小型Google+图标,但它看起来很草率:http://goo.gl/d68eg

2 个答案:

答案 0 :(得分:4)

您可能想要使用addthis_button_google_plusone_share按钮。

答案 1 :(得分:0)

以下是我使用PHP和HTML滚动自己的共享按钮的方法:

    <div class="sharing_buttons">
        <a class="google_plusone sharing" href="https://plus.google.com/share?url=http://YOUR_URL" target="_blank" title="Share on Google+"></a>
        <a class="facebook sharing" href="http://www.facebook.com/sharer.php?u=http://YOUR_URL" target="_blank"title="Share on Facebook"></a>
        <a class="twitter sharing" href="http://twitter.com/home?status=YOUR TWEET GOES HERE" target="_blank" title="Share on Twitter"></a>
        <a class="linkedin sharing" href="http://www.linkedin.com/shareArticle?mini=true&url=
        <?php echo urlencode('YOUR_URL'); ?>
        &title=<?php echo urlencode('YOUR TITLE HERE'); ?>
        &summary=<?php echo urlencode('WRITE A SUMMARY HERE (SPACES WILL BE ENCODED)'); ?>
        &source=<?php echo urlencode('@4click'); ?>" target="_blank" title="Share on LinkedIn"></a>
        <a class="button_email sharing" href="mailto:?subject=YOUR SUBJECT&body=BODY OF THE EMAIL" target="_blank" title="Share via e-mail"></a>
    </div>

使用CSS添加图标图形。例如:

.google_plusone { background:url(../img/sharing_sprite.png) 0px 0px; }

此解决方案的局限性在于您没有AddThis提供的跟踪功能,但我使用HootSuite跟踪社交分享,因此对我来说这不是什么大问题。