Looking back over my notes, the opacity trick is very similar to the visibility one, except that I used an on page style sheet to set the initial style for the iframe. That approach may coax the visibility method to work as well. However, it also relied upon having a source for the iframe (as in solution 1 from this thread), guess I was covering all the bases. In short, if method 1 works, stick with it. OK, for the opacity method, put this in the head:
Code:
<style type="text/css">
#dynstuff {
filter:alpha(opacity=0);
-moz-opacity:0.00;
opacity:0.00;
}
</style>
Add to the script as shown:
Code:
function random_iframe(){
if (ie||dom){
var iframeobj=document.getElementById? document.getElementById("dynstuff") : document.all.dynstuff
iframeobj.src=randomcontent[Math.floor(Math.random()*randomcontent.length)]
if (iframeobj.filters)
iframeobj.filters[0].opacity=100;
else{
iframeobj.style.MozOpacity=1.0;
iframeobj.style.opacity=1.0;
}
}
}
Bookmarks