最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Remove or customise "via @ShareThis" when adding ShareThis button dynamically - Stack Overflow

programmeradmin1浏览0评论

I want to customise the "via @sharethis" part of the sharethis Twitter share button.

Everything I can find (/ for example) says to add st_via="TwitterUsername" to the ShareThis span <span class="st_twitter" st_via="TwitterUsername">… however, I am dynamically adding the buttons so am unable to do this.

Here is how I create the buttons:

var defaults = {
            "service": "twitter",
            "element": …,
            … etc,
}

stWidget.addEntry(defaults);

How can I customise or remove the "via @ShareThis" part of the resulting twitter share button?

I want to customise the "via @sharethis" part of the sharethis Twitter share button.

Everything I can find (http://blog.sharethis./2012/04/30/via-sharethis-is-here-2/ for example) says to add st_via="TwitterUsername" to the ShareThis span <span class="st_twitter" st_via="TwitterUsername">… however, I am dynamically adding the buttons so am unable to do this.

Here is how I create the buttons:

var defaults = {
            "service": "twitter",
            "element": …,
            … etc,
}

stWidget.addEntry(defaults);

How can I customise or remove the "via @ShareThis" part of the resulting twitter share button?

Share Improve this question asked May 7, 2013 at 7:59 Ned MartinNed Martin 5327 silver badges13 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 10

Boss, just add the st_via="[@theathere]" attribute to the span

<span id='twitter' class='twitter' st_via='[@theathere]'></span>

<script type='text/javascript'>
   var defaults = {
            "service": "twitter",
            "element": …,
            … etc,
   }

   stWidget.addEntry(defaults);

</script>

it will automatically add the st_via='' try it.

发布评论

评论列表(0)

  1. 暂无评论