javascript - Call a function after the Twitter widget has fully loaded -
i'm having bit of issue @ moment twitter api. have sidebar uses javascript dynamically measure height of footer upon page load , page resize.
i've placed twitter widget footer, causing issue twitter widget loads last, no matter place within javascript file.
i've tried use event handler calling measuring function after twitter widget has loaded, still doesn't make difference.
does have suggestions?
you have few options solve problem. use js method such .setinterval continue loop until twitter widget in dom , execute function. or alternatively use settimeout , force update footer function wait until twitter widget present. recommend former.
if you're not comfortable using setinterval - might want check out handy plugin waits until specified element inserted dom. check it: https://gist.github.com/buu700/4200601
asynchronous loading of third party widgets typically causes few headaches. above solutions should point in right direction sorting out problem.
finally - know twitter widget allows set specified height in widget settings on twitter account? might solve problem: https://dev.twitter.com/web/embedded-timelines#dimensions
good luck!
Comments
Post a Comment