问题描述
我刚刚在我的评论页面上实现了FB Like按钮,Google +1按钮,Digg和Tweet按钮,请参阅这里:
I just recently implemented the FB Like button, Google +1 button, Digg and Tweet buttons on my review pages, see here:
然而,因为Facebook Like按钮会根据某人是否曾经点击喜欢而改变宽度,所以按钮之间的间距是不一致的。有没有办法动态设置元素的宽度,取决于是否有任何类似的,或(我猜这是更容易)只是显示一个0的小计数框,如果有0个喜欢,而不是隐藏它,使得元素总是相同的宽度?
However, because the Facebook Like button changes width depending on whether someone has ever clicked "like", the spacing between buttons is inconsistent. Is there some way to dynamically set the width of the element depending on whether there are any like, OR (and I'm guessing this is easier) just show the little count box with a "0" in it if there are 0 likes instead of hiding it so that the element is always the same width?
谢谢!
推荐答案
将Facebook像按钮放在一个固定宽度的div中,然后应该被限制到该宽度。
Put the Facebook like button inside a div with a fixed width and then it should be constrained to that width.
这篇关于动态Facebook喜欢按钮宽度或显示喜欢计数即使有0喜欢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!