Facebook之类的按钮未显示在FancyBox中? [英] Facebook like button not displaying in FancyBox?

查看:70
本文介绍了Facebook之类的按钮未显示在FancyBox中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在显示我的所有帖子的页面上应用了Facebook 喜欢的按钮我的WordPress管理员.我应用了Facebook的 like按钮代码,在这里工作正常,但是当用户单击该帖子时,该帖子将在 FancyBox ,我在其中应用Facebook的 like按钮,但在那里没有创建Facebook的 like按钮.我该怎么办?

I have applied the Facebook like button on a page where I am displaying all the post from my WordPress admin. I applied the Facebook like button code, and it is working fine here, but when user clicks on the post, that post is getting open in FancyBox where I am applying the Facebook like button, but the Facebook like button is not getting created there. How can I do this?

这是我用来在两个地方创建Facebook like按钮的代码:

This is the code I am using to create the Facebook like button at both places:

<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/en_US/all.js#xfbml=1&appId=145332828885141";
        fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
</script>

<div class="fb-like"
     data-href="https://www.facebook.com/pages/PHPsyms/130379690383205"
     data-send="false"
     data-layout="button_count"
     data-width="450"
     data-show-faces="false"></div>

推荐答案

它将在FancyBox中工作:

It will work in FancyBox:

<iframe
    src="http://www.facebook.com/plugins/like.php?href=URL_HERE%2F&amp;layout=button_count&amp;show-faces=false&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light"
    scrolling="no"
    frameborder="0"
    allowTransparency="true"
    style="border:none;
    overflow:hidden;
    width:110px;
    height:px">
</iframe>

这篇关于Facebook之类的按钮未显示在FancyBox中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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