关键js代码:
/*扩充左边树区域宽度 start*/
function MouseDownToResize(obj){
obj.mouseDownX=event.clientX;
obj.pareneTdW=obj.parentElement.parentElement.offsetWidth;
obj.setCapture();
}
function MouseMoveToResize(obj){
if(!obj.mouseDownX) return false;
var newWidth=obj.pareneTdW*1+event.clientX*1-obj.mouseDownX;
if(newWidth>0&&newWidth>240)
{
obj.parentElement.parentElement.style.width = newWidth;
configcheck_div_leftmenu01.style.width=newWidth-10;
}
}
function MouseUpToResize(obj){
obj.releaseCapture();
obj.mouseDownX=0;
}
/*扩充左边树区域宽度 end*/
<style>
.resizeDivClass
{
width:3px;
cursor:e-resize;
height:700px;
float: left;
}
</style>
<table>
<tr>
<td>
<div id="configcheck_div_leftmenu02" class="resizeDivClass" οnmοusedοwn="MouseDownToResize(this);" οnmοusemοve="MouseMoveToResize(this);" οnmοuseup="MouseUpToResize(this);"></div>
</td>
<td>
</td>
</tr>
</table>