facebook社交插件加载完成后如何加载函数方法? [英] How to load a function method after facebook social plugin is has finished loaded?

查看:133
本文介绍了facebook社交插件加载完成后如何加载函数方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用jQuery砌筑布局网站上的列表项,每个列表项都有一个fb:comments.异步加载SDK,甚至可以放置方法"$ container.masonry('reload');" FB.init()之后,列表项仍然重叠.

I have jQuery masonry to layout the list items on my website, each list item has a fb:comments. Loading SDK asynchronously, even putting the method "$container.masonry( 'reload' );" after FB.init() the list items are still overlapping.

我测试了在重新装填石工之前放置一个alert()框,如果快速关闭该警告框,则该项目仍会重叠,但是如果过一会儿将其关闭,则该框会正确显示并留有余量.因此,我假设砌体重新加载在fb:comments的内容加载完成之前开始.

I tested putting an alert() box before reload masonry, if close the alert box quickly the items are still overlapping but if close it after a while it display correctly with margin. So I assume the masonry reload runs before the content of fb:comments finish loaded.

在fb:comments内容完成加载后,如何触发砌体重新加载?不能通过单击按钮.图片显示了何时重叠以及fb:comments之后砌筑物重新加载.

How do I trigger masonry reload after the content of fb:comments finish loaded? Not by button click. Images show when it's overlapping and masonry reload after fb:comments.

推荐答案

如果您使用xfbml版本的插件,则可以订阅xfbml.render-在所有插件(调用)完成后触发. http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/

If you use xfbml version of plugins, you can subscribe to xfbml.render - fired when all plugin (calls) completes. http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/

这篇关于facebook社交插件加载完成后如何加载函数方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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