Facebook 点赞按钮(XFBML 版本)高度
我对 Facebook 点赞按钮的高度有疑问。我使用带有此标签的 XFBML 版本
<fb:like layout="standard" show_faces="true" width="440" action="recommend" colorscheme="light"></fb:like>
在某些网站上,包含按钮的 iframe 的高度是动态的。当有“面孔”要显示时,它的高度为 61px;当没有面孔要显示时,它的高度为 23px。当用户按下“喜欢”按钮时(并且按钮下方会出现他的脸),这种情况会发生动态变化。
适用的网站示例:
- hobby.idnes.cz/v-boji-s-mokrou-travou-vitezi-vretenove-sekani-nad-rotacnimi-sekackami-13j-/hobby-zahrada.asp
- ?c=A100604_134111_hobby - zahrada_bma Like 按钮演示页面 - http://developers.facebook.com/docs/reference/plugins /like
不幸的是,当我尝试将标签插入到我的页面中时,iframe 的高度设置为 80px 并且没有改变。
我当前的解决方案是将盒子的高度设置为23px,并将其容器的溢出CSS属性设置为隐藏。但通过这个解决方案,我失去了展示面孔的能力。
这个问题已经发布在 Stack Overflow 上,但没有解决方案。 - stackoverflow.com/questions/2777196/facebook-like-button-fblike-height-always-80px
我花了大约 6 个小时试图解决这个问题。但我仍然认为必须有一个简单的解决方案。
感谢您的任何建议。
I'm having a problem with the height of the Facebook Like button. I use the XFBML version with this tag
<fb:like layout="standard" show_faces="true" width="440" action="recommend" colorscheme="light"></fb:like>
On some sites, the height of the iframe which contains the button is dynamic. It has the height of 61px, when there are "faces" to display and 23px when there are no faces to display. This changes dynamcally when the user presses the like button (and a his face appears undes the button).
Examples of sites where this works:
- hobby.idnes.cz/v-boji-s-mokrou-travou-vitezi-vretenove-sekani-nad-rotacnimi-sekackami-13j-/hobby-zahrada.asp?c=A100604_134111_hobby-zahrada_bma
- Facebook Like Button demo page - http://developers.facebook.com/docs/reference/plugins/like
Unfortunately, when I try to insert the tag into my page, the height of the iframe is set to 80px and it doesn't change.
My current solution is to set the height of the box to 23px and set the overflow CSS property of its container to hidden. But with this solution I lose the ability to show faces.
This problem is already posted here on Stack Overflow, but with no solution. - stackoverflow.com/questions/2777196/facebook-like-button-fblike-height-always-80px
I've spent about 6 hours trying to figure this problem out. But I still think there must be a simple solution for this.
Thanks for any suggestions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您不想显示面孔,并保持静态 23px 高度,可以将 XFBML
fb:like
标记上的show_faces
参数设置为false< /代码>。如果您确实想显示面孔,我会将
标签包装在容器div
中,并将其height
设置为61px
。这应该允许“like”按钮周围的任何内容保持在原位,并且 iframe/like 按钮的内容会随着面孔的添加/删除而变化。If you don't want to show faces, and keep the static 23px height, you can set the
show_faces
parameter on the XFBMLfb:like
tag tofalse
. If you DO want to show faces, I'd wrap the<fb:like>
tag in a containerdiv
and set it'sheight
to61px
. This should allow whatever content is around the like button to stay in place, and the content of the iframe/like button change as faces are added/removed.