三个div显示隐藏并位置调整控制(encoding-utf8)

<html>
<HEAD><TITLE></TITLE>
<style>
.TITLE_S {font-size:12px; color: #2160ad; BACKGROUND-COLOR: #ecf7fb;
    border-top-width: 1px;
border-right-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-color:#d2e1e4;
height:19px; padding:1px 8px 0px 8px ; text-align:right;}

.TITLE_I{font-size:12px; color: #2160ad; BACKGROUND-COLOR: #ffffff;
    border-top-width: 1px;
border-right-width: 1px;
border-top-style: solid;
border-right-style: solid;
    border-color:#d2e1e4;
    height:19px; padding:5px 2px 3px 10px ; }

INPUT.INPUT { COLOR: #515050; FONT-SIZE:11px; height:18; margin:-3 0 -2 0 }
</style>

<script>
    function pageInit(){
        var form = document.queryApplyCondition;
        var chkObj = form.q_search_type;
        if(chkObj){
            if(chkObj.length){
                for(var i = 0; i < chkObj.length; i++){
                    if(chkObj[i].value == "0"){//기간별 검색 조건은 디폴트로 열어줌.
                        chkObj[i].checked = true;
                    } else {
                        chkObj[i].checked = false;
                    }
                    chkObj[i].fireEvent('onclick');
                }
            }else{//length == 1
                if(chkObj.value == "0"){//기간별 검색 조건은 디폴트로 열어줌.
                    chkObj.checked = true;
                } else {
                    chkObj.checked = false;
                }
                chkObj.fireEvent('onclick');
            }
        } else {
            //해당 Object가 존재하지 않음.
        }
    }

/**
* UI Event
*/
function onClickSearchType(chkObjElement) {
   //alert("object=" + chkObjElement);
   //alert("checked=" + chkObjElement.checked);
   //alert("value=" + chkObjElement.value);
   //alert(layout[parseInt(chkObjElement.value)]);
  
   var form = document.queryApplyCondition;
   var chkObj = form.q_search_type;
  
   var checkedCnt = 0;
   for(var i = 0; i < chkObj.length; i++){
       if(chkObj[i].checked && chkObj[i].value != chkObjElement.value){
           checkedCnt++;
       }
   }
  
   var condition1 = document.getElementById("div_condition1");
   var condition2 = document.getElementById("div_condition2");
   var condition3 = document.getElementById("div_condition3");
  
   var currentDiv;
   switch(chkObjElement.value){
       case "0"://기간별 검색
           currentDiv = condition1;
           break;
       case "1"://사용자별 검색
           currentDiv = condition2;
           break;
       case "2"://신청항목별 검색
           currentDiv = condition3;
           break;
       default:
           alert("value error![value=" + chkObjElement.value + "]");
           break;
   }
  
    var displayDivs = new Array();
    var displayDivsIdx = 0;
    if(condition1.style.display == "") {
        displayDivs[displayDivsIdx++] = condition1;
    }
  
    if(condition2.style.display == "") {
        displayDivs[displayDivsIdx++] = condition2;
    }
  
    if(condition3.style.display == "") {
        displayDivs[displayDivsIdx++] = condition3;
    }
  
    if(chkObjElement.checked){
        if(currentDiv.style.display == "") {
            return;
        } else {
            currentDiv.style.display = "";
           
            var lastDisplayDivs = new Array();
            var lastDisplayDivsIdx = 0;
            var div_exist = false;
            for(var i = 0; i < displayDivs.length; i++){
                lastDisplayDivs[lastDisplayDivsIdx++] = displayDivs[i];
                if(displayDivs[i] == currentDiv){
                    div_exist = true;
                }
            }
            if(!div_exist){
                lastDisplayDivs[lastDisplayDivsIdx++] = currentDiv;
            }
           
            //lastDisplayDivs -- Order by
            for(var i = 0; i < lastDisplayDivs.length; i++){
                for(var j = i + 1; j < lastDisplayDivs.length; j++){
                    if(lastDisplayDivs[i].id > lastDisplayDivs[j].id){
                        var orderTempObj = lastDisplayDivs[i];
                        lastDisplayDivs[i] = lastDisplayDivs[j];
                        lastDisplayDivs[j] = orderTempObj;
                    }
                }
            }
           
            var pxLeft = 15;
            for(var i = 0; i < lastDisplayDivs.length; i++){
                lastDisplayDivs[i].style.left = new String(pxLeft) + "px";
                pxLeft = pxLeft + parseInt(lastDisplayDivs[i].style.width) + 5;
            }
        }
    } else {
        if(currentDiv.style.display == "none"){
            return;
        } else {
            currentDiv.style.display = "none";

            var lastDisplayDivs = new Array();
            var lastDisplayDivsIdx = 0;
            for(var i = 0; i < displayDivs.length; i++){
                if(displayDivs[i] != currentDiv){
                    lastDisplayDivs[lastDisplayDivsIdx++] = displayDivs[i];
                }
            }

            var pxLeft = 15;
            for(var i = 0; i < lastDisplayDivs.length; i++){
                lastDisplayDivs[i].style.left = new String(pxLeft) + "px";
                pxLeft = pxLeft + parseInt(lastDisplayDivs[i].style.width) + 5;
            }
        }
    }
}

</script>
</HEAD>

<BODY topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" οnlοad="javascript:pageInit();">
<form name='queryApplyCondition' >

<table class="headBlank" border="0" cellpadding="0" cellspacing="0">
    <tr><td style="font-size:1px">&nbsp;</td></tr>
</table>

<DIV ID="page_title" STYLE="left:15px;top:30px; width:837px;height:25px;border-width:0;border-color:#AACCFF;border-style:solid;position:absolute;overflow:no;">
<p style="padding:3 3 0 0;width:360px;height:23px;text-align:left;text-valign=top;FONT-SIZE:13px;">&nbsp;
<input type="checkbox" name="q_search_type" value="0" class="INPUT" οnclick="javascript:onClickSearchType(this);"/>&nbsp;기간별 검색&nbsp;&nbsp;&nbsp;
<input type="checkbox" name="q_search_type" value="1" class="INPUT" οnclick="javascript:onClickSearchType(this);"/>&nbsp;사용자별 검색&nbsp;&nbsp;&nbsp;
<input type="checkbox" name="q_search_type" value="2" class="INPUT" οnclick="javascript:onClickSearchType(this);"/>&nbsp;신청항목별 검색&nbsp;&nbsp;&nbsp;
</p>
</DIV>

<DIV ID="div_condition1" STYLE="left:15px;top:60px; width:260px;height:120px; background-color:#FFFFFF;border-width:0;border-color:#AACCFF;border-style:solid;position:absolute;overflow:no">
<TABLE cellspacing="0" cellpadding="0" border="0" height='120px'><!-- width:336px -->
<TR valign="top">
    <TD CLASS='TITLE_I' WIDTH='250px' style="border-left-width: 1px;border-left-style: solid;border-bottom-width: 1px;border-bottom-style: solid;text-align:left;text-valign:top;">
      <span style="height:25px;">
        <input type="radio" name="q_period_type" value="1" class="INPUT" style="margin:0 0 0 0"/>&nbsp;신청일자기준&nbsp;&nbsp;&nbsp;
        <input type="radio" name="q_period_type" value="2" class="INPUT" style="margin:0 0 0 0"/>&nbsp;처리일자기준&nbsp;&nbsp;&nbsp;
      </span>
      <span style="height:25px;">
        &nbsp;기간&nbsp;&nbsp;<input type="text" name="q_start_date" size="10" class="INPUT" style="margin:0 0 0 0"/>&nbsp;~&nbsp;<input type="text" name="q_end_date" size="10" class="INPUT" style="margin:0 0 0 0"/>
      </span>
      <span style="height:25px;">
        &nbsp;&nbsp;&nbsp;&nbsp;월&nbsp;&nbsp;
          <select name="sel_period_months" class="INPUT">
            <option value="4">4개월</option>
            <option value="5">5개월</option>
            <option value="6">6개월</option>
            <option value="7">7개월</option>
            <option value="8">8개월</option>
            <option value="9">9개월</option>
            <option value="10">10개월</option>
            <option value="11">11개월</option>
            <option value="12">1년</option>
          </select>
      </span>
    </TD>
</TR>
</TABLE>
</DIV>

<DIV ID="div_condition2" STYLE="left:280px;top:60px; width:260px;height:120px; background-color:#FFFFFF;border-width:0;border-color:#AACCFF;border-style:solid;position:absolute;overflow:no;display:;">
<TABLE cellspacing="0" cellpadding="0" border="0" height='120px'><!-- width:336px -->
<TR valign="top">
    <TD CLASS='TITLE_I' WIDTH='250px' style="border-left-width: 1px;border-left-style: solid;border-bottom-width: 1px;border-bottom-style: solid;text-align:left;text-valign:top;">
       <span style="height:25px;">
        &nbsp;사용자&nbsp;
        <input type="text" name="q_user_name" class="INPUT" size="10" style="margin:0 0 0 0"/>&nbsp;
      </span>
      <span style="height:25px;">
        <input type="radio" name="q_user_type" value="1" class="INPUT" style="margin:0 0 0 0"/>&nbsp;정규직원&nbsp;&nbsp;&nbsp;
        <input type="radio" name="q_period_type" value="2" class="INPUT" style="margin:0 0 0 0"/>&nbsp;출장자&nbsp;&nbsp;&nbsp;
        <input type="radio" name="q_period_type" value="3" class="INPUT" style="margin:0 0 0 0"/>&nbsp;외부인력&nbsp;&nbsp;&nbsp;
      </span>
      <span style="height:25px;">
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;부서&nbsp;
          <input type="text" name="q_user_name" class="INPUT" size="10" style="margin:0 0 0 0"/>&nbsp;
      </span>
    </TD>
</TR>
</TABLE>
</DIV>

<DIV ID="div_condition3" STYLE="left:545px;top:60px; width:290px;height:120px; background-color:#FFFFFF;border-width:0;border-color:#AACCFF;border-style:solid;position:absolute;overflow:no;display:;">
<TABLE cellspacing="0" cellpadding="0" border="0" height='115px'><!-- width:336px -->
<TR valign="top">
    <TD CLASS='TITLE_I' WIDTH='290px' style="border-left-width: 1px;border-left-style: solid;border-bottom-width: 1px;border-bottom-style: solid;text-align:left;text-valign:top;">
      <TABLE cellspacing="0" cellpadding="0" border="0" height='110px'>
    <TR valign="top">
      <TD style="font-size:12px;color: #2160ad;BACKGROUND-COLOR: #ffffff;border-color:#ffffff;padding:0px 0px 0px 5px;">
        <input type="checkbox" name="chk_request_item_general" value="01" class="INPUT" style="margin:0 0 0 0"/>&nbsp;Removal Disk&nbsp;&nbsp;&nbsp;
      </TD>
      <TD style="font-size:12px;color: #2160ad;BACKGROUND-COLOR: #ffffff;border-color:#ffffff;padding:0px 0px 0px 5px;">
        <input type="checkbox" name="chk_request_item_general" value="05" class="INPUT" style="margin:0 0 0 0"/>&nbsp;COM1&nbsp;&nbsp;&nbsp;
      </TD>
    </TR>
    <TR valign="top">
      <TD style="font-size:12px;color: #2160ad;BACKGROUND-COLOR: #ffffff;border-color:#ffffff;padding:0px 0px 0px 5px;">
        <input type="checkbox" name="chk_request_item_general" value="02" class="INPUT" style="margin:0 0 0 0"/>&nbsp;Control Attaching Mobile&nbsp;&nbsp;&nbsp;<br/>
      </TD>
      <TD style="font-size:12px;color: #2160ad;BACKGROUND-COLOR: #ffffff;border-color:#ffffff;padding:0px 0px 0px 5px;">
        <input type="checkbox" name="chk_request_item_general" value="06" class="INPUT" style="margin:0 0 0 0"/>&nbsp;COM2&nbsp;&nbsp;&nbsp;<br/>
      </TD>
    </TR>
    <TR valign="top">
      <TD style="font-size:12px;color: #2160ad;BACKGROUND-COLOR: #ffffff;border-color:#ffffff;padding:0px 0px 0px 5px;">
        <input type="checkbox" name="chk_request_item_general" value="03" class="INPUT" style="margin:0 0 0 0"/>&nbsp;Fixed CD ROM/RW&nbsp;&nbsp;&nbsp;
      </TD>
      <TD style="font-size:12px;color: #2160ad;BACKGROUND-COLOR: #ffffff;border-color:#ffffff;padding:0px 0px 0px 5px;">
        <input type="checkbox" name="chk_request_item_general" value="07" class="INPUT" style="margin:0 0 0 0"/>&nbsp;COM3&nbsp;&nbsp;&nbsp;
      </TD>
    </TR>
    <TR valign="top">
      <TD style="font-size:12px;color: #2160ad;BACKGROUND-COLOR: #ffffff;border-color:#ffffff;padding:0px 0px 0px 5px;">
        <input type="checkbox" name="chk_request_item_general" value="04" class="INPUT" style="margin:0 0 0 0"/>&nbsp;Fixed FDD&nbsp;&nbsp;&nbsp;<br/>
      </TD>
      <TD style="font-size:12px;color: #2160ad;BACKGROUND-COLOR: #ffffff;border-color:#ffffff;padding:0px 0px 0px 5px;">
        <input type="checkbox" name="chk_request_item_general" value="08" class="INPUT" style="margin:0 0 0 0"/>&nbsp;COM4&nbsp;&nbsp;&nbsp;
      </TD>
    </TR>
    <TR valign="top">
      <TD style="font-size:12px;color: #2160ad;BACKGROUND-COLOR: #ffffff;border-color:#ffffff;padding:0px 0px 0px 5px;">
        <input type="checkbox" name="chk_request_item_special" value="01" class="INPUT" style="margin:0 0 0 0"/>&nbsp;External Internet&nbsp;&nbsp;&nbsp;
      </TD>
      <TD style="font-size:12px;color: #2160ad;BACKGROUND-COLOR: #ffffff;border-color:#ffffff;padding:0px 0px 0px 5px;">
        <input type="checkbox" name="chk_request_item_special" value="02" class="INPUT" style="margin:0 0 0 0"/>&nbsp;MSN&nbsp;&nbsp;&nbsp;
      </TD>
    </TR>
      </TABLE>
    </TD>
</TR>
</TABLE>
</DIV>

<table class="headBlank" border="0" cellpadding="0" cellspacing="0">
    <tr><td style="font-size:1px">&nbsp;</td></tr>
</table>

</form>
</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值