ihorko
ihorko

Reputation: 6945

Hide counter on FaceBook Like button

I have simple html page with FaceBook Like button:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"  "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/">
<head>
  <script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>

<div id="fb-root"></div>
<script type="text/javascript">

    window.fbAsyncInit = function() {
        FB.init({
            status: true, // check login status
            cookie: true, // enable cookies to allow the server to access the session
            xfbml: true, // parse XFBML
            channelURL: 'http://myurl.com', // channel.html file
            oauth: true // enable OAuth 2.0
        });
    };
    (function(d) {
        var js, id = 'facebook-jssdk'; if (d.getElementById(id)) { return; }
        js = d.createElement('script'); js.id = id; js.async = true;
        js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
        d.getElementsByTagName('head')[0].appendChild(js);
    } (document));


</script>

<fb:like href="http://myurl.com" layout="button_count" show_faces="false" width="450" height="35" action="like" colorscheme="light" font="trebuchet ms" allowTransparency="true"></fb:like>

</body>
</html>

How can I hide counter next to button?

Thanks a lot!

Upvotes: 2

Views: 3290

Answers (3)

bodomalo
bodomalo

Reputation: 173

I've tested several versions now. a) You get many problems on different browsers, you have to check every browser version b) There is a noscript addon named "ClearClick" - it will warn/prevent users from clicking on such a hidden FB Button. There is no solution against that. Well there is 1 solution, the hidden space must be OUTSIDe the screen so ClearClick can not reender it and does not warn the user. But you do not want your like button on the top of your page I believe.

Upvotes: 1

Xenon
Xenon

Reputation: 815

Choose standart facebook like button from John's link it will be ok! ;)

Upvotes: 0

John Charette
John Charette

Reputation: 148

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.

Upvotes: 2

Related Questions