zoukankan      html  css  js  c++  java
  • 好代码

    function ftest()
    {
    var kk=0;
    var kk2=0;
    kk
    =document.all("aa").offsetLeft;
    kk2
    =document.all("aa").offsetTop;
    document.all(
    "Layer1").style.top=kk2+document.all("aa").offsetHeight;
    document.all(
    "Layer1").style.left=kk;
    document.all(
    "Layer1").style.width=document.getElementById("aa").style.width;
    document.all(
    "Layer1").style.visibility = "visible";
    document.getElementById(
    "caidn").rows(0).cells(0).innerHTML=document.getElementById("aa").value;
    }
    function fClose()
    {
    document.all(
    "Layer1").style.visibility = "hidden";
    }
    function trOnMouseOver(trid) {
    document.all(
    "caidn").bgColor="#cccc99";
    //alert(document.getElementById("caidn").rows(0).cells(0).innerHTML);
    //
    alert(document.all("caidn").rows(0).cells(0).innerHTML);
    document.getElementById("aa").value=document.getElementById("caidn").rows(trid).cells(0).innerText;
    fClose();
    }

    function trOnMouseOver2(trid) {
    alert(document.getElementById(
    "ppp").rows(trid).cells(0).innerText);
    //alert(document.getElementById("ppp").rows(0).cells(0).innerText);
    }




    <form name="form1" method="post" action="">
      <input name="aa" type="text" id="aa" size="20" style="100" onKeyUp="ftest();">

      <input type="button" name="test" value="按钮" onClick="ftest();">
      <input type="button" name="test2" value="按钮2" onClick="trOnMouseOver();">
    </form>

    <div id="Layer1" style="position:absolute; 200px; height:115px; z-index:1; top: 260px; left: 22px; background-color: #FFFFFF; layer-background-color: #FFFFFF; border: 1px none #000000; visibility: hidden;">
      <table border="0" cellpadding="0" cellspacing="0" id="caidn">
        <tr onClick="trOnMouseOver(this.rowIndex);" onmouseout="this.style.backgroundColor='ffffff'"
            onmouseover="this.style.backgroundColor='ffc080'">
          <td width="50" height="22">AA</td>  <td width="50" height="22">BB</td>
        </tr>
      <tr onClick="trOnMouseOver(this.rowIndex);" onmouseout="this.style.backgroundColor='ffffff'"
            onmouseover="this.style.backgroundColor='ffc080'">
          <td width="50" height="22">CC</td>  <td width="50" height="22">DD</td>
        </tr>
    </table>

    </div>
    <table border="1" cellpadding="0" cellspacing="0" id="ppp">
      <tr onClick="trOnMouseOver2(this.rowIndex);">
          <td width="50" height="22">AA</td>  <td width="50" height="22">BB</td>
        </tr>
      <tr onClick="trOnMouseOver2(this.rowIndex);">
          <td width="50" height="22">CC</td>  <td width="50" height="22">DD</td>
        </tr>
    </table>

  • 相关阅读:
    poj 1655 Balancing Act 树的重心
    poj 1985 Cow Marathon 树的直径
    hdu 4607 Park Visit 求树的直径
    hdu 1548 A strange lift 宽搜bfs+优先队列
    poj 2711 Leapin' Lizards && BZOJ 1066: [SCOI2007]蜥蜴 最大流
    poj 2449 Remmarguts' Date K短路+A*
    hdu 1285 确定比赛名次 拓扑排序
    hdu 3061 Battle 最大权闭合图
    hdu 3879 Base Station 最大权闭合图
    poj 2987 Firing 最大权闭合图
  • 原文地址:https://www.cnblogs.com/chinatefl/p/216953.html
Copyright © 2011-2022 走看看