Trying to call hovercards on tweets dynamically inserted into page


#1

Hello, I am trying to call hovercards on tweets that are being inserted into the page via livetwitter for jQuery (https://github.com/elektronaut/jquery.livetwitter) like so, though nothing is working. Any ideas why this isn’t working in the callback function that livetwitter provides? Any help would be greatly appreciated. Thanks!

$("#tweets ").liveTwitter('#test', {imageSize: '48px', refresh: false}, function(container, newCount) { twttr.anywhere(function (T) { T.hovercards(); }); });

#2

Since I’m completely unfamiliar with this library, I would suggest contacting the author for help here.


#3

The solution would be to call $(…).hovercard({…}) on the newly added DOM elements after you add them. e.g.

$(“body”).append(“New element.”);
$(“body a.hovercard”).hovercard({…});
if you need more clarification, let me know… :smiley:


#4

:slight_smile:


#5

#6