开发者

Like button with layout=button_count blows out the default 90px

I am using an iframe version of the FBL Like button with the button_count layout. I also have set show_faces=false. This layout used to show ( and the code generator still shows ) just the like button and a count box with the number of likes.

Now it seems to be displaying a my name linked to the right of the like button and then a string below my name with the number of other users who like t开发者_开发技巧he page. The Like button documentation says that the default width is 90 pixels and this is what I specify in the iframe code, however this new layout does not fit within 90 px.

Like button with layout=button_count blows out the default 90px

Does anyone know how I can get the old layout back or is this a case of facebook changing functionality and not updating the docs?


Try this: for all the query strings in src, change all the & to &


Just set data-layout="button_count", and you'll get a smaller version.


I think this is a case of Facebook changing functionality without updating the docs.

It seems the iFrame version of the like button now ignores the button_count layout parameter and displays the standard layout anyways. To solve it just switch to the HTML5 or XFBML version.


That is the standard view format.

layout=button_count is the layout that you are lookign for to accomplish this.

Minimum width: 90 pixels. Default width: 90 pixels. Height: 20 pixels

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) {return;}
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div class="fb-like" data-send="false" data-layout="button_count" data-width="90" data-show-faces="false" data-font="lucida grande"></div>


•layout - there are three options. 
   •standard - displays social text to the right of the button and friends' profile photos below. Minimum width: 225 pixels. Default width: 450 pixels. Height: 35 pixels (without photos) or 80 pixels (with photos). 
   •button_count - displays the total number of likes to the right of the button. Minimum width: 90 pixels. Default width: 90 pixels. Height: 20 pixels. 
   •box_count - displays the total number of likes above the button. Minimum width: 55 pixels. Default width: 55 pixels. Height: 65 pixels.

Source: Facebook Developers

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜