PDA

View Full Version : How to hide windowed controls under DIV tag



murari_amar
Mar 7th, 2007, 08:31 AM
Hi All,
I am using usercontrol(.ascx) in my application which contains a DIV tag which will be visible only onmouseover of a label.
I am using the above said user control in aspx pages which contains web controls like dropdowns, textboxes etc........ on mouse over on the label the div tag will be made visible but due to a common bug in IE6 and older versions the div tag is overlaped by dropdowns(i.e. select boxes) which should not happen.
But when I use the js-calender provided by Zaptec in the same page the dropdowns under the calender are hidden can any body help me with the logic behind this.
Note: I am in need of a generic code which can be used in usercontrol i.e. .ascx and implemented where ever required.
Thanks
Amar

vwphillips
Mar 7th, 2007, 09:11 AM
// Add IFrame (08-November-2006)
// by Vic Phillips http://www.vicsjavascripts.org.uk/

// Pass the object to 'zxcAddIFrame' when ever the object position of visibility is changed.

function zxcAddIFrame(zxcobj){
if (!document.all){ return; }
if (typeof(zxcobj)=='string'){ zxcobj=document.getElementById(zxcid); }
if (!zxcobj){ return; }
if (!zxcobj.ifr){
zxcES(zxcobj,{zIndex:(zxcStyleValue(zxcobj,'z-Index')||'2')});
zxcobj.ifr=zxcES('IFRAME',{position:'absolute',overflow:'hidden',zIndex:(parseInt(zxcStyleValue(zxco bj,'zIndex'))-1),visibility:'visible'},zxcobj.parentNode);
}
zxcES(zxcobj.ifr,{zIndex:(parseInt(zxcStyleValue(zxcobj,'zIndex'))-1),visibility:zxcStyleValue(zxcobj,'visibility')||'hidden',left:zxcobj.offsetLeft+'px',top:zxcobj.of fsetTop+'px', width:zxcStyleValue(zxcobj,'width'),height:zxcStyleValue(zxcobj,'height')});
}

function zxcES(zxcele,zxcstyle,zxcp){
if (typeof(zxcele)=='string'){ zxcele=document.createElement(zxcele); }
for (key in zxcstyle){ zxcele.style[key]=zxcstyle[key]; }
if (zxcp){ zxcp.appendChild(zxcele); }
return zxcele;
}

function zxcStyleValue(zxcobj,zxcp){
if (zxcobj.currentStyle) return zxcobj.currentStyle[zxcp.replace('-','')];
return document.defaultView.getComputedStyle(zxcobj,null).getPropertyValue(zxcp.toLowerCase());
}

chump2877
Mar 7th, 2007, 11:47 AM
I didn't really look through Vic's code, but as far as I know the iframe is the only element that can have a CSS z-index higher than a select element in IE 6...