您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

拖拉表格的JS函数_javascript技巧

2025/6/13 5:14:24发布26次查看
js:
复制代码 代码如下:
/*
@parem object the tbody's object
@parem object tr's object (must be null)
@parem string the classname of onmousedown
@parem string the classname of onmouseout
*/
function order(tt,old,classover,classout) {
var sf = arguments.callee; //get the function self
var trs = tt.getelementsbytagname('tr');
for(var i=0;itrs[i].onmousedown = function () {
if(this.style.cursor == 'move') {
return false;
}
classout = this.classname;
this.classname = classover;
this.style.cursor = 'move';
old = this;
}
trs[i].onmouseover = function () {
if(this.style.cursor == 'move' || !old) {
return false;
}
var tmp_old = old.clonenode(true);
var tmp_now = this.clonenode(true);
var p = this.parentnode;
p.replacechild(tmp_now,old);
p.replacechild(tmp_old,this);
sf(tt,tmp_old,classover,classout);
}
trs[i].onmouseout = function () {
//this.classname = classout;
}
trs[i].onmouseup = function () {
this.classname = classout;
this.style.cursor = '';
old = null;
}
}
}
示例: 
复制代码 代码如下:
无标题文档
id
记录
1
记录
2
记录
3
记录
4
记录
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product