Facebook Like Button - how to disable Comment pop up box?

牧云@^-^@ 提交于 2019-12-02 14:03:14

问题


I'd like to disable the Comment box that pops up when a user clicks the Facebook Like button ,

I followed the post Facebook Like Button - how to disable Comment pop up? and changed the CSS But it didnt work any other suggestions please

I cant use IFRAME otherwise i would not be able to use FB.Event.subscribe('edge.create',


回答1:


From http://developers.facebook.com/docs/reference/plugins/like/:

When will users have the option to add a comment to the like?

If you are using the XFBML version of the Like button, users will always have the option to add a comment. > If you are using the Iframe version of the button, users will have the option to comments if you are using > the 'standard' layout with a width of at least 400 pixels. If users do add a comment, the story published > back to Facebook is given more prominence.

Just use the iframe version of the button and set the width to less than 400 pixels.




回答2:


Just add a style attribute with overflow: hidden

<div style="overflow: hidden !important;" class="fb-like" data-href="<?php echo $url; ?>" data-layout="button_count" data-action="like" data-show-faces="false" data-share="true"></div>



回答3:


Place the iframe within a div and use overflow hidden with a width and height that hides anything except for the button.

I tried to change the css from within the iframe but that didn't work for me.




回答4:


create a custom css class like,

.fb-like{
overflow: hidden !important;
}

mention the class into facebook DIV

That's it...



来源:https://stackoverflow.com/questions/10742492/facebook-like-button-how-to-disable-comment-pop-up-box

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!