实现可动态改变宽度的表格简单方法(2)

2008-02-23 09:33:49来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折


{
document.getElementById("table1").rows[i].cells[parseInt(curColumn)-1].className=cNameRoot (leftID);
document.getElementById("table1").rows[i].cells[parseInt(curColumn) 1].className=cNameRoot (rightID);
}
}
}
}

function tmOut()
{
//tmYes="0"
}

function tmUp()
{
tmYes="0"
window.status="*";
}

var ColumnCount=(document.getElementById("table1").rows[0].cells.length)/2;
var ID0=new Array(ColumnCount);
var ID1=new Array(ColumnCount);
var ID2=new Array(ColumnCount);
var idSum;

function tmDown()
{
var className0;
tmYes="1";
idSum=0;
for(var i=0;i<ColumnCount;i )
{
className0=document.getElementById("table1").rows[0].cells[i*2].className;
ID0[i]=className0.substring(cNameRoot.length,className0.length);
ID2[i]=0;
idSum =parseInt(ID0[i]);
}
for(var i=0;i<ColumnCount;i )
{
ID1[i]=ID0[i]/idSum;
}
mLeft=event.clientX;
}


function tmMove()
{
if(tmYes=="1")
{
var curLeft;
curLeft=event.clientX;
for(var i=0;i<ColumnCount;i )
{
ID2[i]=parseInt(ID0[i]) parseInt((parseInt(curLeft) - parseInt(mLeft)) * ID1[i])
}
//window.status = mLeft ";" curLeft "||||" ID1[0] ";" ID1[1] ";" ID1[2] " |||| " ID0[0] ";" ID0[1] ";" ID0[2] " |||| " ID2[0] ";" ID2[1] ";" ID2[2] ";";
for(var i=0;i<rowCount;i )
{
for(var j=0;j<ColumnCount;j )
{
document.getElementById("table1").rows[i].cells[j*2].className=cNameRoot (ID2[j]);
}
}
}
}

< /script>

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:asp写的日志处理方法

下一篇:ASP中的日期函数