嵌入式推文完成事件? [英] Embedded tweets completion event?

查看:62
本文介绍了嵌入式推文完成事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对单个推文使用Twitter的嵌入代码会导致加载名为widget.js的脚本.该脚本负责动态生成推文的HTML.

Using Twitter's embed code for single tweets causes a script called widget.js to be loaded. This script is responsible for dynamically generating the HTML of the tweet.

嵌入式推文的渲染完成后,是否有一个由widget.js触发的事件?我的代码如何找出渲染完成的地方?

Is there an event triggered by widget.js when the rendering of an embedded tweet is complete? How can my code find out that rendering is complete?

我需要这个,因为我试图使用jQuery Masonry来布局一组推文.砌筑会在完全渲染tweet之前,固定每个tweet的容器​​高度,从而导致重叠.我希望收到通知,所有推文均已完全渲染,以刷新砌体布局.

I need this because I am trying to use jQuery Masonry to layout a set of tweets. Masonry fixes the container height for each tweet before the tweets are fully rendered, causing overlap. I'd like to be notified that all tweets are fully rendered in order to refresh the Masonry layout.

推荐答案

我最终使用了jQuery监视"插件(例如 https://github.com/darcyclarke/jQuery-Watch-Plugin )来监视容器div上的DOM变化.

I ended up using a jQuery "watch" plugin (e.g. https://github.com/darcyclarke/jQuery-Watch-Plugin) to watch for DOM changes on the container div.

这篇关于嵌入式推文完成事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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