Click to See Complete Forum and Search --> : JAVASCRIPT: Layer vs. listbox problem ...


bogu
04-14-2006, 06:11 AM
Hi there; simple question ... I have a layer that, when extended, appears under the dropdown listbox.

Is there any suggestion on how to make it appear overtop?

And does anyone know of a tutorial or something like yahoo mail or gmail have for the address book, when you start enter the email address to witch u want to send an email a layer appear with the all email addresses from your address book that contains what u entered into that field?

Thanks, any help is real appreciated …

JPnyc
04-14-2006, 12:35 PM
You do this with the CSS z-index property. The element in question must be absolutely positioned for this property to have effect in IE.

MarkR
04-14-2006, 01:05 PM
By "A layer", do you mean an absolutely positioned element?

In some browsers, native widgets are used, which stops elements going over them - this includes <select> elements in some versions of MSIE.

There is no fix. Consider using radio buttons instead, which I think are not natively rendered in recent version of MSIE, hence respect z-index properly.

I think that all HTML elements are rendered in Mozilla and IE7 + , but not IE6 and below. Not sure about other browsers.

Mark

bogu
04-20-2006, 06:49 AM
By "A layer", do you mean an absolutely positioned element?
Yes.

Is sad for this IE bug; because of this lots of people are refusing to use layers (absolutely positioned elements) and u cand do lots of nice things...

The best solution if to make the layer not appear near a list box...

I know that is a work around for this bug by hide the elements if it appears under a layer but I dont know how I can determine wich elements are under my layer and witch are not.

bpat1434
04-20-2006, 01:55 PM
Can't you put a containing div element around the area where your layer will show up. Then when your new layer shows up, just put:
document.getElementById('containingDiv').style.visibility='hidden';
and wham! it's hidden the elements under the div!!

bogu
04-21-2006, 03:42 AM
Can't you put a containing div element around the area where your layer will show up.

The layer will be random size, so I want the layer script to be independent and should not depend where I show it on the page...

bpat1434
04-21-2006, 08:28 AM
The layer size won't matter.... as long as the layer is around the elements you want to hide, the size won't matter.