I'm loading in an iframe
from an external site (twitter feed) and want to use JS
to change the css styles.
The JS code is:
$(".twitter-timeline").contents().find(".p-name").css("font-size","16px");
});
The problem is that I can't seem to get this to execute after the iframe's contents have loaded. I tried opening the function with:
$('iframe.twitter-timeline').load(function(){
or
$('#twitter-widget-0').load(function(){
but they seem to be triggering before the iframe finishes loading. When I refresh the page, the styles are applied as intended. But if i clear my cache and retest again it won't work unless i refresh.
If I use
window.setTimeout(function(){
and give it 3 seconds or so, it works sometimes, depending on internet speed, so I prefer not to use it.