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?

29 of 34 people (85%) answered Yes
Recently 9 of 10 people (90%) answered Yes

Entry

I used a menu in my web page but it can't over the listbox under it. How can I do?

Apr 5th, 2008 19:30
ha mo, Dave Clark, Nguyen Nam Trung,


Nguyen,
Sorry, it is not possible to cover a FORM element that is not hidden in 
some other fashion.  You see, FORM elements are not really HTML 
objects.  In Windows, at least, they are Windows objects that are 
reused by the browser *as* FORM elements.  Thus, these operating system 
objects do not have z-index attributes -- as other HTML objects do -- 
and, therefore, they cannot be covered by normal HTML objects.
The solution?  You will have to simultaneously hide any FORM elements 
that are in the way of your menu.  For example (in IE):
var fld = document.formName.fieldName;
fld.style.visibility = "hidden"; // or "visible"
Since NS4 does not support hiding a single FORM element, you would 
have to place the entire FORM within a DIV layer and hide the entire 
FORM by hiding just the DIV layer.  For example (in NS4):
var myDiv = document.layers["divID"];
myDiv.visibility = "hide"; // or "show"
This would, however, create added complexity to addressing your FORM.  
NS DIV layers have their own document object, so a "normal" FORM field 
reference like this:
document.formName.fieldName
would have to, when within an NS DIV layer, be referenced as follows:
document.layers["divID"].document.formName.fieldName
OK?   ;-)
Take care,
Dave Clark
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