faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

63 of 75 people (84%) answered Yes
Recently 8 of 10 people (80%) answered Yes

Entry

Dropdown fields appear through a div, which z-index is set to 1000. How can I cover these fields?

Apr 6th, 2008 19:32
ha mo, Ole Clausen, Holger Wellmann,


As you'll see here:
  http://support.microsoft.com/support/kb/articles/Q177/3/78.ASP
a dropdown will appear on another z-index plane than 'ordinary' DHTML 
elements.
A way around this is to put the content of the div in a windowed 
element, like a scriptlet:
<object type="text/x-scriptlet" data="your_page.html" 
style="position:absolute;z-index:2"></object>
If you give your object an id, you'll be able to manipulate it - just 
like any DHTML element.
Another way around the problem is to hide all (or a specific) dropdown, 
when showing the div. MS do that in their banners that cover the whole 
page when you hover them. Something like this:
function hideElms(elmTag) {
	for (i=0; i<document.all.tags(elmTag).length; i++){
		obj = document.all.tags(elmTag)[i];
		if (!obj || !obj.offsetParent) continue;
		obj.style.visibility = "hidden";
	}
}
function showDiv(obj) {
	hideElms('SELECT');
	obj.style.visibility = "visible";
}
Hope this will give you some inspiration on how to solve the problem in 
your specific case.
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com