I am using a Twitter widget in my site which is in an iframe. I am styling this iframe without any problem. The problem I have is that I first see the old let's say iframe and then I can see the changes to the styled one. Is there a way to have the iframe hidden while all the css/style changes are happening on the background and then make it visible?
I using this jquery:
$(document).ready(function(){
hideTwitterBoxElements();
});
var hideTwitterAttempts = 0;
function hideTwitterBoxElements() {
setTimeout( function() {
if ( $('[id*=twitter]').length ) {
$('[id*=twitter]').each( function(){
var ibody = $(this).contents().find( 'body' );
ibody.find(".timeline .stream").css("padding-top", "10px")
if ( ibody.find(".timeline .stream .h-feed li.tweet").length )
ibody.find(".timeline").css("background-color","transparent");
ibody.find(".customisable-border").css("border","none");
ibody.find(".timeline .stream").css("overflow","hidden");
}
});
}
hideTwitterAttempts++;
if ( hideTwitterAttempts < 3 ) {
hideTwitterBoxElements();
$("#twitter").show();
}
}, 1500);
}
And what happens is that when I load the page, the iframe comes after a while (which I also could like to reduce the time if possible) and then I can see for example the overflow changing to hidden.
Thanks in advance.