//alert(sch.scrollHeight);
if (sch.style.display == "")
{
dMain.style.height = windowHeight - 100 - sch.scrollHeight;
}
else
{
dMain.style.height = windowHeight - 120;
}
//dMain.style.display = "none";
//寻找Top 和 Left
var tt = dMain; // 寻找左上角的坐标,代码来自梅花雪的日期控件
var th = tt;
var ttop = tt.offsetTop;
var thei = tt.clientHeight;
var tleft = tt.offsetLeft;
var ttyp = tt.type;
while (tt = tt.offsetParent){ttop+=tt.offsetTop; tleft+=tt.offsetLeft;}
var myTop = (ttyp=="image")? ttop+thei : ttop+thei+6; //左上角的坐标
var myLeft = tleft; //左上角的坐标
//===================================寻找完毕===============
hh = dMain.style.height; //修正
hh = hh.replace("px","");
myTop = myTop - hh + 12;
var dg = document.getElementById("DG"); //显示数据的表格
var RowsCount = "1"; //锁定行数
var LineCount = "1"; //锁定列数
//锁定行的高度
var RowsHeight = dg.rows[RowsCount].cells[0].offsetTop - dg.rows[0].cells[0].offsetTop + 2
//锁定列的宽度
var LineWidth = dg.rows[0].cells[LineCount].offsetLeft - dg.rows[0].cells[0].offsetLeft + 2
//锁定列的高度
var LineHeight = dMain.style.height;
LineHeight = LineHeight.replace("px","");
//锁定行的宽度
var RowsWidth = dMain.style.width;
RowsWidth = RowsWidth.replace("px","");
//hh = parseint(hh);
//赋值
divResize(dMain,dTop,dLeft,dMid);
if (RowsHeight <25)
RowsHeight = 25;
if (LineWidth <20)
LineWidth = 20;
dTop.style.width = RowsWidth - 16;
dTop.style.height = RowsHeight;
dLeft.style.width = LineWidth;
dLeft.style.height = LineHeight - 16;
dMid.style.width = LineWidth ;
dMid.style.height = RowsHeight;
//设置左上角的位置
dTop.style.top = myTop ;
dTop.style.left = myLeft ;
dLeft.style.top = myTop;
dLeft.style.left = myLeft;
dMid.style.top = myTop;
dMid.style.left = myLeft;
}
function divResize(dMain,dTop,dLeft,dMid)
{
dTop.innerHTML = dMain.innerHTML;
dMid.innerHTML = dMain.innerHTML;
dLeft.innerHTML = dMain.innerHTML;
dLeft = dMain;
}
function divResize2(dMain,dLeft)
{
dLeft.innerHTML = dMain.innerHTML;
}
function myScroll(me)
{
var dTop = document.getElementById("dTop");
var dLeft = document.getElementById("dLeft");
var dMid = document.getElementById("dMid"); //左上角的Div
dTop.scrollLeft = me.scrollLeft;
dLeft.scrollTop = me.scrollTop;
//dMid.scrollLeft = me.scrollLeft;
//dMid.scrollTop = me.scrollTop;
}