I have a Twitter widget (a Javascript widget that embeds an iFrame) on my site. Previously, I used
iframe[id^='twitter-widget-']{ width:100% !important;}
to change the widget width to 100%, instead of default 520px. It worked very well until yesterday. For somehow, that CSS setting on iframe does not work anymore. I checked the iFrame source code, it appears Twiiter adds this
.timeline {
max-width: 520px;
}
Because this iframe is from twitter, I have no way to use css to modify .timeline. I tried to use Jquery/javascript:
$("#twitter-widget-0").contents().find(".timeline").css("max-width","100%");
But it seems only working on console. I put this line of JavaScript in a PHP template file and it does not work. I have tried body onLoad, window onload and document onload and none works. I also put this javascript at the end of my template file and it does not either.
How to resolve this issue?
Thanks,