Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Irritating IE6 problem

Status
Not open for further replies.

Dweezel

Technical User
Feb 12, 2004
428
GB
Does anyone know of a simple method to make a select element that appears underneath a dhtml menu not appear in front of dropdowns of that menu in IE6?

If you're not sure what I'm talking about view the following page in IE7 or Firefox and then in IE6:


You'll see that in IE6 the select element appears over the dropdown menu. I've tried various methods suggested on the internet which were either unsuitable (one involved putting the select element in a div and hiding it whenever the menu was moused over - too annoying for the user I think), or I couldn't get them to work for me (this included positioning an iframe over the select element).

Can anyone offer me any help or advice with this one please?

TIA.
 
What I have had to do is write a script that when you mouseover the link and display the dhtml menu, you hide all INPUT type="SELECT" elements. And then when you mouseout, you need to unhide them. This is the code that I use, you will have to modify it for your own uses:
Code:
function hideSelect()
{
    var selElems=document.getElementsByTagName('select');
    var numElems=selElems.length;
    for(i=0; i < numElems; i++) {
        selElems[i].style.visibility = "hidden";
    }
}
function unhideSelect()
{
    var selElems=document.getElementsByTagName('select');
    var numElems=selElems.length;
    for(i=0; i < numElems; i++) {
        selElems[i].style.visibility = "visible";
    }
}

Hope this helps - it is really just a work-around for IE6's limitations (all IE's prior to 7 really).

Einstein47
There are no kangaroos in Austria!
[&#91;]Starbase47.com]
 
Thanks Einstein47. Is there a way to have the show/hide system above operate only if the user is using Internet Explorer version 6 or below.

TIA.
 
Yes, you can load it as external javascript through [google]IE conditional comments[/google].

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top