0
我正在尝试构建推文弹出链接。Twitter鸣叫链接不显示
我的HTML代码如下
<p class="col-xs-5 col-xs-offset-1" id="custom-tweet-button">
<a class="twitter-share-button shareButton twitter popup" href="http://twitter.com/share?text=My Custom text" data-text="My Custom text" data-count="none" data-url="https://www.google.com">
<img src="32399/images/social/tweet2.png" alt="" />
</a>
</p>
的JavaScript代码是
$('.popup').click(function(event) {
var width = 575,
height = 400,
left = ($(window).width() - width)/2,
top = ($(window).height() - height)/2,
url = this.href,
opts = 'status=1' +
',width=' + width +
',height=' + height +
',top=' + top +
',left=' + left;
window.open(url, 'twitter', opts);
return false;
});
问题是,当弹出发生,它只是显示的文本。 来自teh data-url的URL没有得到显示。我需要在推文链接中显示URL。
我创建了一个样本的jsfiddle
正如你可以看到,数据的URL不习惯于如何使用?
嗯是的。但是,添加该twitter代码片段代码也会导致我的自定义图像消失。我可以通过在链接中的文字后添加来解决这个问题 –