View Full Version : Layer Hell!!

04-21-2003, 04:31 PM
Ok, so i have these layers on my page...and i also have some dropdown combo boxes/other form elements.....which decide they want to show through my layer.....what kinda work around can i use for this pain in the ***?

Roy Sinclair
04-21-2003, 04:39 PM
The best solution is to rearrange the page so they don't conflict, unfortunately that's also not an option for many pages. The next best solution is to control the visibility of the form elements whenever a layer is over them, but that one can be really difficult if you have to support Netscape 4 users.

What you can't do is the one reasonable thing, namely being able to set the z-index of the form fields so that don't show through the layers. This is a long-standing problem in the browsers that seems tailor made to drive developers crazy.

04-21-2003, 04:48 PM
so is there a code to hide form elements on the page while the layer is showing? where could i find it/how would i go about it?

04-21-2003, 07:48 PM
i tried scouring the internet....and i found nothing that i think can help me...anyone out there have any suggestions?

Roy Sinclair
04-21-2003, 09:08 PM
It's the same code you'd use for hiding or displaying any other element (assuming you're using a standard routine or routines for that purpose). The key is that when you display the layer you need to also hide whatever form element(s) it will overlap, likewise when you hide that layer you need to also make the form element(s) visible again. The only caveat to watch out for is that when two layers may cover all or part of the same form field you want to make sure that you don't create a conflict situation where hiding one layer causes the form field to be displayed even though another layer is also still covering the field. That may not be a problem for you but you should be aware of it up front in case it could become a problem.

(All the above advice assumes that Netscape 4 is NOT a consideration).