Possible Duplicate:
Cross-browser window resize event - JavaScript / jQuery
Jquery flash of unstyled content (IE only)
I have a div (#container) where on a click event I swap out an image and replace it with a YouTube video:
$("#feature_content").click(function(){
var iframe = "<iframe />";
var url = "http://www.youtube.com/embedlink";
$(iframe, {
name: 'videoframe',
id: 'videoframe',
src: url,
width: '600',
height: '335',
frameborder: 0,
allowfullscreen: true
}).appendTo(this);
$(this).find('img').fadeOut(function() { $(this).remove();});
});
However, I am getting a flash of unstyled content (the iframe) BELOW the div before the video starts playing.
This is happening in IE and Chrome, but not Firefox