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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With