<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆 - 154  文章 - 60  trackbacks - 0
    <2007年10月>
    30123456
    78910111213
    14151617181920
    21222324252627
    28293031123
    45678910

    聲明:

    該blog是為了收集資料,認識朋友,學習、提高技術,所以本blog的內容除非聲明,否則一律為轉載!!

    感謝那些公開自己技術成果的高人們!!!

    支持開源,尊重他人的勞動!!

    常用鏈接

    留言簿(3)

    隨筆分類(148)

    隨筆檔案(143)

    收藏夾(2)

    其他

    學習(技術)

    觀察思考(非技術)

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    這里是所有代碼:

    以下是代碼片段:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "

    <html xmlns=" <head>
    <title>新建網頁</title>
    <meta http-equiv="content-type" content="text/html; charset=gb2312" />
    <meta http-equiv="Content-Language" content="zh-CN" />
    <meta name="robots" content="all" />
    <meta name="author" content="lybykw |
    <meta name="Copyright" content="Copyright (c) 2000-2005 <link rel="icon" href="/favicon.ico" type="image/x-icon" media="screen" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" media="screen" />
    <link rel="stylesheet" href="/css/main.css" type="text/css" media="all" />
    <script type="text/javascript" src="/js/main.js"></script>
    <meta name="description" content="網頁制作" />
    <meta name="keywords" content="" />

    <style type="text/css">
    <!--

    -->
    </style>

    <script language="javascript">
    <!--
      var tbody, headRow;
    var bDragMode = false;
    var objDragItem;
    var arrHitTest = new Array();
    var iArrayHit = false;
    var ColumnCount = null;
    var mustRefresh = false;
    var dragColor=null;
    var hitColor=null;
    var HasTopMostPager=null;
     var PowerTable=null;
    //
    // Init function.. Fills out variables with data
    // loaded with oncontentready.
    //將table初始化
    function initDragTable(table)
    {

    var i;

        PowerTable=table;

     if (dragColor == null)
      dragColor = "white";
     if (hitColor == null)
      hitColor = "lightblue";

     // get TBODY - take the first TBODY for the table
     tbody = PowerTable.tBodies(0);

     if (!tbody) return;

     // get THEAD - take the unique THEAD for the table
     var click = PowerTable.tHead;
     if (!click)  return;


     // Determine the row to use (read from HasPager)
     if (HasTopMostPager == "true")
      headRow = click.children[1];
     else
      headRow = click.children[0];

      if (headRow.tagName != "TR") return;

      headRow.runtimeStyle.cursor = "hand"; //"move";
      ColumnCount = headRow.children.length;

      for(i=0; i < ColumnCount ; i++)
      {
        arrHitTest[i] = new Array();
      }


      var cx=0;
      var cy=0;
      var c;
      defaultTitleColor = headRow.children[0].currentStyle.backgroundColor;

      for (i=0; i<ColumnCount ; i++) {

     var clickCell = headRow.children[i];
     clickCell.selectIndex = i;
     c = clickCell.offsetParent;


     if (cx == 0 && cy == 0)
     {
      while (c.offsetParent != null) {
                      cy += c.offsetTop;
                      cx += c.offsetLeft;
                      c = c.offsetParent;
      }
     }

     arrHitTest[i][0] = cx + clickCell.offsetLeft;
     arrHitTest[i][1] = cy + clickCell.offsetTop;
     arrHitTest[i][2] = clickCell;
     arrHitTest[i][3] = cx + clickCell.offsetLeft + clickCell.clientWidth;

     clickCell.attachEvent("onmousedown",onMouseDown);
      }

      PowerTable.attachEvent("onmousemove",onMouseMove);
      PowerTable.attachEvent("onmouseup",onMouseUp);

      ///////
      if (arrHitTest[0][0] == arrHitTest[0][3])
     mustRefresh = true;
    }


    function InitHeader()
    {
      var cx=0;
      var cy=0;
      var c;

      for (i=0; i<ColumnCount ; i++) {

     var clickCell = headRow.children[i];
     clickCell.selectIndex = i;
     c = clickCell.offsetParent;

     if(cx == 0 && cy == 0 )
     {
      while (c.offsetParent != null) {
                      cy += c.offsetTop;
                      cx += c.offsetLeft;
                      c = c.offsetParent;
      }
     }

     arrHitTest[i][0] = cx + clickCell.offsetLeft;
     arrHitTest[i][1] = cy + clickCell.offsetTop;
     arrHitTest[i][2] = clickCell;
     arrHitTest[i][3] = cx + clickCell.offsetLeft + clickCell.clientWidth;

      }
    }


    function ChangeHeader(iChange)
    {
     for(var y = 0; y < arrHitTest.length; y++)
     {
     if (arrHitTest[y][2].currentStyle.backgroundColor == hitColor)
      arrHitTest[y][2].style.backgroundColor = defaultTitleColor;
     }

     if(iChange == "-1") return;

     arrHitTest[iChange][2].style.backgroundColor = hitColor;
    }

    function onMouseUp(e)
    {
     if(!bDragMode) return;
     bDragMode = false;

     var iSelected = objDragItem.selectIndex;

     objDragItem.removeNode(true);
     objDragItem = null;

     ChangeHeader(-1);

     if( (iArrayHit - 1) < 0 || iSelected < 0) return; // default faliure

     // iSelected is the 0-based index of the column being moved
     // (iArrayHit-1) is the 0-based index of the column being replaced
     CopyRow(iSelected, (iArrayHit - 1) );

     // Reset our variables
     iSelected = 0;
     iArrayHit = -1;
    }

    function onMouseDown(e)
    {
     // If the grid is contained in an invisible panel (other DHTML stuff)
     // the initialization step must be repeated to take real values
     if( mustRefresh) {
      InitHeader();
      mustRefresh = false;
     }


     bDragMode  = true;
     var src  = e.srcElement;
     var c  = e.srcElement;

     while (src.tagName != "TD")
      src = src.parentElement;

     // Create our header on the fly
     objDragItem = document.createElement("DIV");
     objDragItem.innerHTML  = src.innerHTML;
     objDragItem.style.height = src.offsetParent.clientHeight;
     objDragItem.style.width  = src.clientWidth;
     objDragItem.style.background = dragColor;
     objDragItem.style.fontColor = src.currentStyle.fontColor;
     objDragItem.style.position  = "absolute";
     objDragItem.style.filter  = "progid:DXImageTransform.Microsoft.Alpha(opacity=75)";
     objDragItem.selectIndex  = src.selectIndex;
            objDragItem.style.border  = "1 solid black";
     while (c.offsetParent != null)
            {
      objDragItem.style.y += c.offsetTop;
      objDragItem.style.x += c.offsetLeft;
      c = c.offsetParent;
     }

     objDragItem.style.borderStyle = "dashed";
      objDragItem.style.borderWidth = "1px";
      objDragItem.style.display = "none";

     src.insertBefore(objDragItem);
    }

    function onMouseMove(e)
    {
     if(!bDragMode || !objDragItem) return;

     // If we aren't dragging or our object is null, we return

     // Hardcoded value for height difference
     var midWObj = objDragItem.style.posWidth / 2;
     var midHObj = 12;

     // Save mouse's position in the document
         var intTop = e.clientY +document.body.scrollTop;
         var intLeft = e.clientX + document.body.scrollLeft;


     var cx=0,cy=0;
     var elCurrent = objDragItem.offsetParent;
     if (elCurrent != null)
     {
              while (elCurrent.offsetParent != null) {
                      cx += elCurrent.offsetTop;
                      cy += elCurrent.offsetLeft;
                      elCurrent = elCurrent.offsetParent;
              }
     }

          objDragItem.style.pixelTop  = intTop  - cx - midHObj;
          objDragItem.style.pixelLeft = intLeft - cy - midWObj;


     if(objDragItem.style.display == "none")
      objDragItem.style.display = "";

     iArrayHit = CheckHit(intTop , intLeft , e);

     e.cancelBubble = false;
     e.returnValue = false;
    }

    function CheckHit(x,y,e)
    {
     midWObj = objDragItem.style.posWidth / 2;
     midHObj = 12;


     for(var i=0; i < ColumnCount; i++)
     {
      if( (y) > (arrHitTest[i][0]) && (y) < (arrHitTest[i][3] ))
      {
       ChangeHeader(i);
       return i + 1;
      }
     }
     return -1;
    }

    //
    // Copy from row to row.. Does the Header also.
    //
    function CopyRow(from, to)
    {
     if(from == to) return;


     var origfrom = from;
     var origto = to;
     var iDiff = 0;

     if( from > to )
     {

      iDiff = from - to;

      var saveObj  = headRow.children[from].innerHTML;
      var saveWidth  = headRow.children[from].width;
    for(var i = 0 ; i < iDiff; i++)
      {
       headRow.children[from].innerHTML = headRow.children[from - 1].innerHTML;
       headRow.children[from].width = headRow.children[from - 1].width;
       from--;
      }
      headRow.children[to].innerHTML  = saveObj;
      headRow.children[to].width = saveWidth;
     }
     else
     {

      iDiff = to - from;

      var saveObj = headRow.children[from].innerHTML;
      var saveWidth  = headRow.children[from].width;

      for(var i = 0 ; i < iDiff; i++)
      {
       headRow.children[from].innerHTML = headRow.children[from + 1].innerHTML;
       headRow.children[from].width = headRow.children[from + 1].width;
       from++;
      }

      headRow.children[to].innerHTML  = saveObj;
      headRow.children[to].width = saveWidth;
     }


     for(var i = 0 ; i < headRow.children.length; i++)
       headRow.children[i].selectIndex = i;


     InitHeader();
     for ( var iRowInsert = 0 ; iRowInsert < tbody.rows.length; iRowInsert++ )
     {
      from = origfrom;
      to = origto;
      if( from > to )
      {
       iDiff = from - to;
       var saveObj;
       try {
        saveObj = tbody.children[iRowInsert].children[from].innerHTML;
       } catch(e) { saveObj = null; }
       for(var i = 0 ; i < iDiff; i++)
       {
        try {
         tbody.children[iRowInsert].children[from].innerHTML = tbody.children
    [iRowInsert].children[from - 1].innerHTML;
         from--;
        } catch(e) {}
       }
       if (saveObj != null)
        tbody.children[iRowInsert].children[to].innerHTML = saveObj;
      }
      else
      {
       iDiff = to - from;
       var saveObj;
       try {
        saveObj = tbody.children[iRowInsert].children[from].innerHTML;
       } catch(e) {}
       for(var i = 0 ; i < iDiff; i++)
       {
        try {
         tbody.children[iRowInsert].children[from].innerHTML = tbody.children
    [iRowInsert].children[from + 1].innerHTML;
         from++;
        } catch(e) {}
       }
       try {
        tbody.children[iRowInsert].children[to].innerHTML = saveObj;
       } catch(e) {}
      }
     }

      ////////

      var buf = "";
      for(var i=0; i<headRow.children.length; i++)
      {
       var td = headRow.children[i];
       tmp = td.innerHTML;
       pos = tmp.indexOf("<");
       if (pos > 0)
        tmp = tmp.substring(0, pos);
       else
       {
        if (pos == 0)
         tmp = td.innerText;
       }

       buf += tmp;
       if (i < headRow.children.length-1)
        buf += ",";
      }}


    //-->
    </script>

    </head>
    <body onload="initDragTable(exote)">


    <table border="1" cellpadding="0" cellspacing="0" width="100%" height="" align="center" id="exote">
     <tbody>
     <thead>
     
      <td>世界</td>
      <td>中國</td>
      <td>美國</td>
     
     </thead>
     <tr>
      <td>55</td>
      <td>66</td>
      <td>77</td>
     </tr>
     </tbody>
    </table>

    </body>
    </html>

    posted on 2007-10-09 09:31 lk 閱讀(487) 評論(0)  編輯  收藏 所屬分類: ajax&js
    主站蜘蛛池模板: 免费无码中文字幕A级毛片| 青娱乐在线免费观看视频| 毛片免费全部播放无码| 国产四虎免费精品视频| 最新亚洲卡一卡二卡三新区| 亚洲成A人片在线观看无码3D | 亚洲一区精品中文字幕| 成年性生交大片免费看| 亚洲精品午夜在线观看| 国产成人高清精品免费鸭子 | 亚洲精品卡2卡3卡4卡5卡区| 人成免费在线视频| 亚洲精品欧洲精品| 亚洲精品高清在线| 无码精品A∨在线观看免费| 一区二区免费国产在线观看| 亚洲人色大成年网站在线观看| 亚洲免费黄色网址| a级毛片免费观看在线| 亚洲视频在线观看2018| 大学生一级特黄的免费大片视频| 亚洲jizzjizz在线播放久| 久久亚洲高清综合| 日本一区午夜艳熟免费| 亚洲大成色www永久网站| 日韩一级在线播放免费观看| 久久久久国产精品免费免费不卡| 亚洲AV日韩AV永久无码下载| 啊v在线免费观看| 中文字幕免费在线看电影大全| 久久精品国产精品亚洲艾 | 亚洲免费日韩无码系列| 国产精品亚洲自在线播放页码| 精品免费国产一区二区三区| 处破女第一次亚洲18分钟| 亚洲毛片免费视频| 久久精品国产亚洲av麻豆| 亚洲免费福利在线视频| 少妇性饥渴无码A区免费| 一级A毛片免费观看久久精品| 亚洲国产另类久久久精品|