Facebook HTML5 Like Button - 隐藏评论弹出窗口 [英] Facebook HTML5 Like Button - Hide Comment Popup

查看:150
本文介绍了Facebook HTML5 Like Button - 隐藏评论弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要禁用点击Facebook Like按钮后显示的说出一些关于这个的弹出框。

I need to disable the "Say something about this" popup box that is displayed after clicking the Facebook Like button.

这个简单的解决方案是使用iFrame版本的Like按钮。但是,我的页面由woobox托管。我不能将类似按钮从HTML5更改为iframe版本,但我可以访问添加额外的CSS和Javascript。

The simple solution to this is to use the iFrame version of the Like button. However, my like page is hosted with woobox. I cannot change the like button from HTML5 to the iframe version but I do have access to add additional CSS and Javascript.

已经有一些解决方案发布到Stackoverflow,但一些用户指出他们不再工作 Facebook Like Button - 如何禁用注释弹出?我已经尝试了所有这些解决方案,并可以确认。

There have been a number of solutions posted to Stackoverflow but some users have pointed out that they no longer work Facebook Like Button - how to disable Comment pop up? I have tried all of these solutions and can confirm this.

推荐答案

我能够创造可以帮助你的东西。

Okay, I was able to create something that might help you.

这是JSFiddle: JSFiddle

Here's the JSFiddle: JSFiddle

我基本上做的是把包装好的按钮放在一个隐藏溢出的div中。只有问题是,加载页面后,注释框会出现一秒钟,但会消失。 (它仍然包含在div中,但是它覆盖了类似的按钮一秒)

What I basically did was I wrapped the like button in a div with hidden overflow. Only problem is, the comment box appears for a second right after loading the page, but goes away after. (it's still contained inside the div, but it covers up the like buttons for a second)

另一种方法可能是这样的:更改iFrame元素

Another approach could be something like this: Changing iFrame elements

你会在哪里需要查看源代码并检查Facebook的元素ID以进行注释。 (看起来像 div#u_0_6._56zz._56z )一旦你有id,你可以尝试 .hide() .css('display','none')不幸的是,这个id真的很模糊,看起来像我定期更改。所以如果它改变了,你的代码显然不会奏效。

Where you would need to view the source and check Facebook's element id for the comment box. (looks like it's div#u_0_6._56zz._56z) Once you have the id you can try to .hide() or .css('display', 'none') Unfortunately, this id is really obscure and looks to me like it changes on a regular basis. So if it does change, your code obviously won't work.

JSFiddle似乎有效。它看起来像你唯一的确定选项。

The JSFiddle does seems to work. And it looks like your only sure option.

这篇关于Facebook HTML5 Like Button - 隐藏评论弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆