用javascript实现这个应该不难,就是复杂,需要慢慢调试.
本人认为你根本不需要用纯javascript来实现这个功能,浪费精力与时间,如果必须用就没办法了,但我相信如果不是必须要用到的话,建议你不用,用就用控件应该快得多.
用VB,如果你是用jsp的话,那么就更简单了,因为java是他叔叔嘛,呵呵.

解决方案 »

  1.   

    根据 "zhaoxiaoyang   (梅雪香@深圳)"的资料简单的改了下,你看下是否合你的要求:
    <script>   
     
      var   isDraging = false;   
      var   ox,oy;  function  fnDown(obj)
      {           
      isDraging=true;
      ox = event.offsetX;
      oy = event.offsetY;  
      }
      
      function  fnMove(tid)
      {   
      if(event.button!=1)
      fnRelease();   
      if(isDraging)
      {           
      var th=event.y-oTable.offsetTop-oy;
      if (th<1) 
      th=1;
      if(th+parseInt(tid.height)>parseInt(oTable.height))
      th=parseInt(oTable.height)-parseInt(tid.height);
      document.getElementById(tid).height=th;
      }   
      }
      
      function  fnUp(tid)
      {   
     fnRelease(tid);   
      }
      
      function fnRelease(tid)
      {         
      isDraging = false;  
      }   
      </script>   
      <BODY>   
      <TABLE  id=oTable width=200  height=200 border=1 cellspacing="0" cellpadding="0">   
      <TR><TD id=up bgColor=#330099>11</TD></TR>   
      <TR><TD id=mid   height=40 bgColor=#3366CC onmousedown="fnDown(this);" onmousemove="fnMove('mid');" onmouseup="fnUp();">aaa</TD></TR>   
      <TR><TD id=down bgColor=#330099>33</TD></TR>
      <TR><TD id=mid2   height=30 bgColor=#3366CC onmousedown="fnDown(this);" onmousemove="fnMove('mid2');" onmouseup="fnUp();">aaa222</TD></TR>   
      </TABLE>   
      </BODY>