Javascript 如何删除标准 iframe Facebook Like 按钮的“成为第一个喜欢这个的朋友”部分?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3193749/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to remove the "Be the first of your friends to like this" part of the standard iframe Facebook Like button?
提问by Tom
I'm using the standard Facebook Like button (iframe, not fbml). Is there a way to only display the like button, not the 'Be the first of your friends to like this' part?
我正在使用标准的 Facebook Like 按钮(iframe,而不是 fbml)。有没有办法只显示喜欢按钮,而不是“成为第一个喜欢这个的朋友”部分?
回答by daaku
This is currently not configurable. If you use the button_countlayout, then you won't see that text.
这是当前不可配置的。如果您使用button_count布局,那么您将看不到该文本。
回答by Devner
As of today's date, in the Like Box code, instead of layout=standarduse layout=button_countand that will show the count bubble & remove that text.
截至今天,在 Like Box 代码中,而不是layout=standard使用layout=button_count,这将显示计数气泡并删除该文本。
回答by metaldog
You can simply do this using CSS. Place the like button inside a div. Give the div containing the like button some width. Then set overflow to hidden. Should work!
您可以使用 CSS 简单地做到这一点。将喜欢按钮放在 div 中。给包含喜欢按钮的 div 一些宽度。然后将溢出设置为隐藏。应该管用!
回答by reflexiv
If you want to just have "x people like this" then:
如果您只想拥有“x 个这样的人”,那么:
.fb-like { overflow: hidden; width: 171px; }
If you want to have just the number of people that like it in a box then with the Like Button Generatorselect button_countfrom the Layout Styledrop down.
如果你想拥有的,像它在一个盒子里的人只是数量然后与Like按钮生成器选择button_count从布局样式下拉。
回答by vlood
Checking the code of this WordPress plugin should help you:
检查此 WordPress 插件的代码应该可以帮助您:
http://wordpress.org/extend/plugins/facebook-fan-box-cache/
http://wordpress.org/extend/plugins/facebook-fan-box-cache/
It caches facebook fanbox and then outputs it without iframe. In that way you can remove any part of the box you like.
它缓存 facebook fanbox,然后在没有 iframe 的情况下输出它。通过这种方式,您可以移除您喜欢的盒子的任何部分。
回答by sevcsik
IMO the easiest way is to resize the generated iframe with CSS to 54px width (small button). Unfortunately, the iframe doesn't has a class or ID, but you can match it by src attribute:
IMO 最简单的方法是使用 CSS 将生成的 iframe 调整为 54px 宽度(小按钮)。不幸的是,iframe 没有类或 ID,但您可以通过 src 属性匹配它:
iframe[src*="://www.facebook.com/plugins/like.php?"]
Of course matching it with a descendant selector is easier.
当然,将它与后代选择器匹配更容易。
回答by ????? ???????
If you use components K2. You fix in Items K2
如果您使用组件 K2。您在项目 K2 中修复
Head name "Social Sharing"
头名“社交分享”

