隐藏“追随者"一词来自 Twitter 关注按钮 [英] Hide the word "followers" from Twitter follow button

查看:40
本文介绍了隐藏“追随者"一词来自 Twitter 关注按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法修改 Twitter 的关注"按钮以在气泡中显示关注者数量但隐藏关注者"一词?我基本上希望我的关注"按钮与推特"按钮看起来一样.

Is there a way to modify the Twitter 'follow' button to display the number of followers in a bubble but hide the word "followers"? I basically want my 'follow' button to look the same as the 'tweet' button.

当前代码如下:

<a href="https://twitter.com/User" class="twitter-follow-button" data-show-count="true" 
data-show-screen-name="false" data-dnt="true">Follow @User</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>

推荐答案

我遇到了同样的问题,并通过基本上隐藏了关注者"这个词并为气泡创建了一个假的右边缘来解决它,如果这有意义的话.因此,您必须将按钮包装在其自己的 div 中,然后隐藏该 div 的溢出并将宽度设置为单词消失的确切点,并将高度设置为您正在使用的按钮的高度.这是一个代码示例:

I had this same issue and solved it by basically hiding the word 'followers' and creating a fake right edge to the bubble, if that makes sense. So, you have to wrap the button in its own div, then hide the overflow of that div and set the width to the exact point where the word disappears and the height precisely to the height of the button you are using. Here's a code example:

#titter-div {
    border-radius: 4px; /* to mimic the curved edges of the count box */
    border-right: 1px solid #AAAAAA; /* this is the width and color of the count box border */
    height: 20px; /* this height works for the medium button */
    width: 88px; /* precise width to hide the word */
    overflow: hidden; /* actually hides the word */
}

这对我有用,可以准确地创建您正在寻找的内容.希望这会有所帮助.

This worked for me to create exactly what you are looking for. Hope this helps.

这篇关于隐藏“追随者"一词来自 Twitter 关注按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆