我有一个动态创建的 Twitter 分享按钮:
html:
<a id="twitter_publish" href="https://twitter.com/share" class="twitter-share-button" data-via="3imit" data-count="none"></a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
Javascript:
function tweetSetup() {
$("#twitter_publish").remove();
$(".twitter-share-button").remove();
var tweet = $('<a>')
.attr('href', "https://twitter.com/share")
.attr('id', "twitter_publish")
.attr('class', "twitter-share-button")
.attr('data-lang', "en")
.attr('data-via', "3imit")
.attr('data-count', "none")
.attr('data-text', "Take a look at this:")
.attr('data-url', $("#some_link").val())
.text('Tweet');
$("#facebook_publish").after(tweet);
twttr.widgets.load();
$("#twitter-share-button").show();
}
我想用我自己的图标替换默认的推文图标。我怎样才能做到这一点?