I have a html page in which i have a div. Inside the div there is an iframe,
<div id="div1">
<iframe id="biframe" src="" allowtransparency="true" application="yes" >
</iframe>
</div>
In javascript function I'm changing the src of the iframe dynamically.
window.frames['biframe'].document.location.href="105.htm";
$('div1').style.display="block";
The above 2 lines will be called in a button click, the div will be displayed and the iframe will be loaded.
Problem : When the button is clicked the iframe blinks before getting displayed properly. The flash occurs for a very short time, but very irritating when I'm going to display different source in each button click. For now I have 5 buttons.
Solution Tried : I tried with the below solution given in some forum,
<iframe src="..." style="visibility:hidden;" onload="this.style.visibility='visible';"></iframe>
...but didn't work.
Please suggest a good solution to end this problem.
Note : JQuery/any JS library cant be used in this page (I'm not allowed to).
visibility
to hidden before you assign a new url to it. Also, why are you modifying the iframe's location object? Just change thesrc
of the iframe should work.