Forum Moderators: open
When I mouseover menu items the sub-menus appear behind items on a form e.g. the go behind a select-option-list.
Does anyone know why this happens / how to stop it?
I have tried using z-index in my css file to put the javascript above but this doesn't work.
The select control is a windowed control/element (controlled by the browser and OS) other more manageable controls are windowless.
• Windowed controls have an infinite z-index, that prevents them being hidden.
Ways to overcome this are:
Microsoft Forms Control Box
Used mainly in Visual Basic and accepted throughout applications (IE)
Faults
Will not work in Netscape
[Example of]
<object classid="clsid:8BD21D30-EC42-11CE-9E0D-00AA006002F3" id="combo" name="combo" class="largecombo" height="20">
<param name="DisplayStyle" value="7"><!--VERY IMPORTANT - Use this setting to turn user input off. When this is set to 7 , It behaves like a select box. Remember it is after all a combo( combination between a text and list box) box -->
<param name="ShowDropButtonWhen" value="2"><!--The button on the side need not be visible all the time - you can customize it here-->
<param name="FontName" value="Arial">
<param name="FontHeight" value="180">
</object>
[End Example]
Apart from that there is no other way of beating it! Check out MS what they have done is hide the conflicting select/combo box from view whilst the navigation element is hitting it.
HTH,
-George
Your only workaround is to move your design around so there is no overlap, or hide the form element using CSS when your menu drops down. Obviously this latter option looks a lot cleaner if the whole element is covered.
hide the form element using CSS when your menu drops down
How would I do that?
- I'm a bit nervous about adding code to the javascript as its a 20k external file created by a program I bought to make fancy menus.
- Can I hide the form element via code in the html or the css?
That depends on the way your menus are set up. You need to isolate the Javascript event that triggers the menu to roll down (an onMouseover from the sound of things) and attach something like:
myformelement.style.visibility=='hidden'
to it.
My Javascript ability relies on trial and error a little too much, but maybe a seasoned Javascript guru can step in and elaborate or provide an example.
Going to bed now so this will be tomorrow morning UK time...
-George