问题
I added the following Facebook Like code in my blog. But when I clicked on the button, it showed up a small dialogue window which looks like this: http://www.badongo.com/pic/13928565
I don't want this dialog window. I simply want the count of like button to increase. Someone please help me, thanks!
<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/zh_TW/all.js#appId=189257097820759&xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-like" data-href="imobile.tw" data-send="false" data-layout="box_count" data-width="40" data-show-faces="false"></div>
回答1:
In your CSS:
.fb_edge_comment_widget.fb_iframe_widget { display: none !important }
回答2:
None of these CSS workarounds seem to be working as of now (December 2012), so I advise you to use a more reliable solution: Simply place the fb:like into a div with overflow: hidden
. If the div will be small enough (just to display the Like button), it will work.
Put this into your html file:
<div id="fbLikeContainer">
<fb:like send="false" layout="button_count" width="70" show_faces="false"></fb:like>
</div>
And this into your CSS file:
#fbLikeContainer {
overflow: hidden;
}
If you check the official Like button reference on Facebook developers, particularly the section When I click the Like button, the popup window (or "flyout") doesn't show. Why?, you'll see that that's what Facebook suggests you to do (though unintentionally)
回答3:
After reading the Facebook developer page, I think the new style of a URL "Like" includes the flyout / dialog. You could possibly hide the flyout with a div around the Like button set to the correct size and with the overflow: hidden CSS property assigned to it. The other option is to use the Like button with Facebook pages. This is called the Like Box, but again, only works with Facebook pages / URLs. Perhaps you could create a Facebook page for your site and have all the Like buttons link to that?
Here is the Facebook Like Box generator, which you can turn off most of the features to get just the Like button and not all the extra stuff: http://developers.facebook.com/docs/reference/plugins/like-box/
Here is the Facebook Like Button generator, that has a flyout also, and they mention the flyout might get hidden although don't talk about it as though you might want to hide it: http://developers.facebook.com/docs/reference/plugins/like/
来源:https://stackoverflow.com/questions/8005943/facebook-like-button-shows-strange-dialog-window