#11 IFrame vs Hide/Show

open
nobody
5
2014-08-24
2004-12-29
Michael Schall
No

I'm not sure if this is a cross-browser fix, but it works in
IE and looks better than boxes disappearing.

You can use a iframe to cover the selects. So instead
of calculating what you are over and hiding the objects,
the calendar would just float over top of them the way
it is supposed to.

Example:

var ieULs = xGetElementsByTagName('UL',
document.body);
var iframe = xCreateElement('iframe');
iframe.src = 'about:blank';
iframe.scrolling = 'no';
iframe.frameBorder = "0";
iframe.className = "menuCover";
for (j=0; j<ieULs.length; j++) {
var ieMat = iframe.cloneNode(true);
ieMat.style.width=ieULs
[j].offsetWidth+"px";
ieMat.style.height=ieULs
[j].offsetHeight+"px";
ieULs[j].appendChild( ieMat );
}

.menuCover {
position: absolute;
left: 0;
top: 0;
z-index: -1;
}

Discussion