无论如何,是否可以在同一页面上添加多个推文按钮并拥有自己的推文计数
我正在考虑设置一些推文按钮,供人们使用 #anchor 标签发布长文章的各个部分,
例如这样的 URL
http://www.w3schools.com/html_links.htm#tips
http://www.w3schools.com/html_links.htm#questions
每个锚点标签旁边都会有一个推文按钮
这可能吗?每个推文按钮是否都有自己的自己独特的依靠各自的按钮吗?
例如
<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.w3schools.com/html_links.htm#tips" data-text="I have Tweeted the Tips Link" data-count="horizontal">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.w3schools.com/html_links.htm#questions" data-text="I have Tweeted the Questions Link" data-count="horizontal">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
提前非常感谢
干杯 安迪
I was thinking of setting up some tweet buttons for people to tweet out various sections of a long article using #anchor tags
eg a URL like this
http://www.w3schools.com/html_links.htm#tips
http://www.w3schools.com/html_links.htm#questions
There would be a Tweet button next to each Anchor Tag
Is this possible and will each tweet button have their own unique Count on their respective buttons?
eg
<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.w3schools.com/html_links.htm#tips" data-text="I have Tweeted the Tips Link" data-count="horizontal">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.w3schools.com/html_links.htm#questions" data-text="I have Tweeted the Questions Link" data-count="horizontal">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
Many thanks in advance
Cheers
Andy
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Twitter 忽略其推文按钮计数中的 #fragments,因此链接到单个页面的多个部分的多个推文按钮都将具有相同的计数。您可以在一个页面上有多个不同数量的推文按钮,但它们必须位于单独的页面前面。例如,
example.com
的博客可以有两个计数不同的推文按钮,但它们必须用于:Twitter disregards #fragments in their tweet button counts so multiple tweet buttons linking to multiple sections of a single page will all have the same count. You can have multiple tweet buttons on a single page with different counts but they will have to be fore separate pages. For example a blog of
example.com
could have two tweet buttons with different counts but they would have to be for:解决方法是使用 GET 值。您可以将这种 url 用于 tweeter 按钮:
然后,添加一些 JS,以便当用户来自 tweeter 时跳转到锚点。
A workaround is to play with GET values. You can use this kind of url for the tweeter button :
Then, you add some JS to jump to the anchor when the user come from tweeter.