简体   繁体   English

如何添加动态自定义的ShareThis按钮?

[英]How to add dynamic customized ShareThis button?

I would like to use ShareThis on my site and add multiple buttons for the same service to share multiple objects. 我想在我的网站上使用ShareThis,并为同一服务添加多个按钮以共享多个对象。 This is possible but I could only get the buttons to be in one of the default styles. 这是可能的,但我只能使按钮采用默认样式之一。 How can I add buttons through javascript and still get them with a customized image? 如何通过javascript添加按钮并仍然使用自定义图片来获得按钮?

stWidget.addEntry({
            "service":"facebook",
            "element": $('.fb_custom').get(1),
            "url":"http://sharethis.com",
            "title":"sharethis",
            "type":"large", // one of the default styles
            "text":"ShareThis" ,
            "image":"http://www.softicons.com/download/internet-icons/social-superheros-icons-by-iconshock/png/256/sharethis_hulk.png", // image TO BE SHARED
            "summary":"this is description1"   
        });

没问题,使用type =“ custom”可以解决问题。.不在文档中,至少我找不到它!

Just create new buttons and put them on your server. 只需创建新按钮并将其放置在服务器上即可。 Like this: 像这样:

"image":"http://www.MYOWNSERVER.com/images/myart.png 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM