tags:

views:

1952

answers:

3

In the setup dialog for the Like-Button, there are only two options for layout:

  • Alternative 1
  • Alternative 2

Unfortunately, the numbers for the website of my employer is nowhere near 22'000, so the powers that be have decided that we should not show the number of "likes" until said number is a little more in our favour. As far as I know, I don't have access to the layout of the button through Javascript or CSS (it's in an iframe served by facebook). Are there any other ways to hide the count?

+2  A: 

Adding the following to your css should hide the text element for users and keep FB Happy

.connect_widget_not_connected_text
{
  display:none !important; /*in your stylesheets to hide the counter!*/
}

-- Update

Try using a different approach.

http://www.facebook.com/share/

RobertPitt
At least on Firefox and Chrome, it doesn't help. I tried the same CSS rule without `!important` before asking the question without success, and adding `!important` doesn't seem to change anything. See also the 3rd answer in this question: http://stackoverflow.com/questions/217776/how-to-apply-css-to-iframe
piquadrat
Updated my thread!.
RobertPitt
bounty added: Are there any additional clever things you can do with the Javascript API? perhaps put your own Like button and use the API to 'like' something. i suspect that's not possible but anything else clever?
Simon_Weaver
FACEBOOK SHARE: The box_count and button_count options displays a count of the total number of times the page was shared on Facebook, how many comments were added to the story shared on Facebook, and how many times friends Liked the shared story [http://developers.facebook.com/docs/share]
Simon_Weaver
+2  A: 

Just encompass the iframe in a div set the width to the width of button, set overflow to hidden i.e.

<div style="width:52px;overflow:hidden;">
      <fb:like layout="button_count"></fb:like>

      <div id="fb-root"></div>
      <script>
      window.fbAsyncInit = function() {
      FB.init({appId: 'YOUR_APP_ID', status: true, cookie: true,
      xfbml: true});
      };
      (function() {
      var e = document.createElement('script');
      e.type = 'text/javascript';
      e.src = document.location.protocol +
      '//connect.facebook.net/en_US/all.js';
      e.async = true;
      document.getElementById('fb-root').appendChild(e);
      }());
      </script>
      </div>
Silly Rabbit
this doesn't really work anymore because they've changed the Like button's functionality. i suspect it was partially deliberate to halt this kind of 'behavior' which is likely against terms and conditions. plus watch out because FireBug will complain sometimes if you click on something that is partially hidden as a security measure
Simon_Weaver
+1  A: 

Silly Rabbit is correct. Dont resize the Iframe, that can be deceted from within the page. Use the iframe code provided by facebook at http://developers.facebook.com/docs/reference/plugins/like

then wrap it in a div with height and width and overflow hidden. this cannot be detected from within tha page if you dont have some other facebook javascript or xss reciever stuff on your page

Joe Hopfgartner

related questions