Wrox Programmer Forums
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 29th, 2004, 10:28 AM
Registered User
 
Join Date: Jun 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to shine
Default zIndex


Here I am sending a code

<SCRIPT LANGUAGE=javascript>
function disp_cat_txt(val)
{
var get_name=val.name;
var get_id=val.id;

get_name=new String(get_name);
get_name=get_name.slice(get_name.length-3,get_name.length);
var p_left=document.getElementById(val.id).offsetLeft;
var txt_name="oth_cat"+get_name;
var frst_name="document.form1.";
var lst_name=".focus()"
//alert(document.getElementById(eval('txt_name')).st yle.width)
if(val.value=='Other-specify')
{
if(document.getElementById(eval('txt_name')))
{
//(window.event.srcElement).parentElement.style.zInd ex=0;
//(window.event.srcElement).parentElement.childNodes (0).style.zIndex=100;
//(window.event.srcElement).parentElement.childNodes (1).style.zIndex=-1;

document.getElementById(eval('txt_name')).style.di splay='';
document.getElementById(eval('txt_name')).style.po sLeft=p_left+10;
document.getElementById(eval('txt_name')).style.zI ndex=100;
eval(eval('frst_name+txt_name+lst_name'))
}
}
else
document.getElementById(eval('txt_name')).style.di splay='none';
}
</SCRIPT>

<form>
<input type='text' id='oth_cat200' name='oth_cat200' size=10 style='display:none;position:absolute;' class=shine>
<SELECT onchange="disp_cat_txt(this)" size="1" id="selectcat200" name="selectcat200" style="width:84;font-family:verdana;font-size:7.5pt;font-weight:lighter;position:relative;"><option value=0>select</option><OPTION value='OS'>OS</OPTION<OPTION value='Telecom'>Telecom</OPTION><OPTION value='ERP'>ERP</OPTION><OPTION value='Server'>Server</OPTION><OPTION value='Tool'>Tool</OPTION><OPTION value='Other-specify'>Other-specify</OPTION></SELECT>
</form>

I wrote this code to display text box layer over drop down layer with out hiding it. But it goes under the drop down menu layer. I assigned a positive integer for zIndex property, but the result is same. Please tell me a solution for this. Any suggestion would be greatly appreciated.

regards
shine


august
 
Old January 29th, 2004, 11:08 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

see the archive
http://p2p.wrox.com/topic.asp?TOPIC_ID=6822









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.