如上

解决方案 »

  1.   

    拖选,捕获当鼠标左键按下时,鼠标的移动伪代码如下:
    var leftHasDown = false;
    document.onmousedown = function (){
        if(左键){
            leftHasDown = true;
        }
    };document.onmousemove = function (){
        if(leftHasDown){
            event.toElement.id;//当前鼠标移动到的TD的ID
        }
    };
      

  2.   

    网上找了个拖动的,帮你改了改,不知道是不是你要的效果
     <html>  
       
     <head>  
     <meta http-equiv="Content-Type" content="text/html; charset=gb2312">  
     <title>可以用鼠标拖动的表格</title>  
     </head>  
       
     <body>  
     <SCRIPT LANGUAGE="JavaScript">  
     <!--  
     var currentMoveObj = null;    //当前拖动对象  
     var relLeft;    //鼠标按下位置相对对象位置  
     var relTop;  
     function f_mdown(obj)  
     {  
         currentMoveObj = obj;        //当对象被按下时,记录该对象  
         currentMoveObj.style.position = "absolute";  
         relLeft = event.x - currentMoveObj.style.pixelLeft;  
         relTop = event.y - currentMoveObj.style.pixelTop;  
     }  
     window.document.onmouseup = function()  
     {  
         currentMoveObj = null;    //当鼠标释放时同时释放拖动对象  
     }  
     function f_move(obj)  
     {  
     //获取id
     
         if(currentMoveObj != null)  
         {  
     document.getElementById('div').innerHTML = '你要的id是:'+currentMoveObj.id;
             currentMoveObj.style.pixelLeft=event.x-relLeft;  
             currentMoveObj.style.pixelTop=event.y-relTop;  
         }  
     }  
       
     //-->  
     </SCRIPT>  
     <BODY>  
     <TABLE width="100" border=1 onselectstart="return false"   >  
     <TR>  
         <TD align="center" id="test1" style="position:absolute;left:50;top:50" onmousedown="f_mdown(this)" onmousemove="f_move(this)">test1</TD>   
         <TD align="center" id="test2" style="position:absolute;left:100;top:50" onmousedown="f_mdown(this)" onmousemove="f_move(this)">test2</TD> 
     </TR>  
     </TABLE>   <div id="div" style="position:absolute;left:50;top:300"></div>
     </body>  
       
     </html>
      

  3.   

    大哥,我要的是拖选拖选拖选拖选
    鼠标按下,拖选一个区域块,释放鼠标,获得区域块中table td 的id
      

  4.   

    这效果只有在google的doc见过,LZ可以去看看google是怎么实现的
      

  5.   

    jQuery UI,有提供类似功能的插件:
    http://jqueryui.com/demos/selectable/#display-grid
      

  6.   

    这个链接演示了如何获取选择到的元素ID。
    http://jqueryui.com/demos/selectable/#serialize
      

  7.   

    以前看过这两个jQuery UI的demo,但从没注意过有这功能,呵呵,很好