开发者

Facebook like button (XFBML version) height

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.


If you don't want to show faces, and keep the static 23px height, you can set the show_faces parameter on the XFBML fb:like tag to false. If you DO want to show faces, I'd wrap the <fb:like> tag in a container div and set it's height to 61px. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜