Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embedded tweets completion event?

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.

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?

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.

like image 707
infojunkie Avatar asked Nov 13 '22 01:11

infojunkie


1 Answers

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.

like image 163
infojunkie Avatar answered Dec 12 '22 13:12

infojunkie