<script language="javascript"> 
var isResizing=false;
function Resize_mousedown(event,obj){
obj.mouseDownX=event.clientX;
obj.leftTdW=obj.previousSibling.offsetWidth;
obj.setCapture();
isResizing=true;
}
function Resize_mousemove(event,obj){
if(!isResizing) return ;
    var newWidth=obj.leftTdW*1+event.clientX*1-obj.mouseDownX;
    if(newWidth>0) obj.previousSibling.style.width = newWidth;
    else obj.previousSibling.style.width=1;
}
function Resize_mouseup(event,obj){
if(!isResizing) return;
obj.releaseCapture();
isResizing=false;
}
</script> 
<body style='margin:0' >
<table style="width:100%;height:100%;" border=0  cellspacing=0 cellpadding=0px >
<tr>
<td style="width:150px;">
<iframe zindex=1 id="a" src="http://community.csdn.net/Tree/tree.htm" style="width:100%;height:100%;z-index:9 "></iframe>
</td>
<td style="width:2px;cursor:e-resize;background-color:#cccccc;" onmousedown="Resize_mousedown(event,this);" 
      onmouseup="Resize_mouseup(event,this);" onmousemove="Resize_mousemove(event,this);">
</td>
<td>
<iframe zindex=1 id="b" name="ContentFrame" src="http://community.csdn.net/index.htm" style="width:100%;height:100%;z-index:10"></iframe>
</td>
</tr>
</table>
</body>

解决方案 »

  1.   

    再加一点功能:
    <script language="javascript"> 
    var isResizing=false;
    function Resize_mousedown(event,obj){
    obj.mouseDownX=event.clientX;
    obj.leftTdW=obj.previousSibling.offsetWidth;
    obj.setCapture();
    isResizing=true;
    }
    function Resize_mousemove(event,obj){
    if(!isResizing) return ;
        var newWidth=obj.leftTdW*1+event.clientX*1-obj.mouseDownX;
        if(newWidth>0) obj.previousSibling.style.width = newWidth;
        else obj.previousSibling.style.width=1;
    }
    function Resize_mouseup(event,obj){
    if(!isResizing) return;
    obj.releaseCapture();
    isResizing=false;
    }
    function Resize_setDefault(event,obj){
    if(obj.innerText=="<") {
    obj.parentNode.previousSibling.style.width=1;
    obj.innerText=">";
    }
    else{
    obj.parentNode.previousSibling.style.width=150;
    obj.innerText="<";
    }
    event.cancelBubble=true;
    }
    </script> 
    <body style='margin:0' >
    <table style="width:100%;height:100%;" border=0  cellspacing=0 cellpadding=0px >
    <tr>
    <td style="width:150px;" >
    <iframe zindex=1 id="a" src="http://community.csdn.net/Tree/tree.htm" style="width:100%;height:100%;z-index:9 "></iframe>
    </td>
    <td style="width:3px;cursor:e-resize;background-color:#cccccc;" align="center" valign="middle"
         onmousedown="Resize_mousedown(event,this);" onmouseup="Resize_mouseup(event,this);" onmousemove="Resize_mousemove(event,this);">
         <font style="size:3px;background-color:#eeeeee;cursor:pointer;" onmousedown="Resize_setDefault(event,this);"><</font>
    </td>
    <td>
    <iframe zindex=1 id="b" name="ContentFrame" src="http://community.csdn.net/index.htm" style="width:100%;height:100%;z-index:10"></iframe>
    </td>
    </tr>
    </table>
    </body>