天天躁日日躁狠狠躁AV麻豆-天天躁人人躁人人躁狂躁-天天澡夜夜澡人人澡-天天影视香色欲综合网-国产成人女人在线视频观看-国产成人女人视频在线观看

拖拉表格的JS函數

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;i<trs.length;i++) {
trs[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;
}
}
}

示例: 
復制代碼 代碼如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標題文檔</title>
</head>
<script src="js/ajax.js"></script>
<script src="js/global.js"></script>
<style type="text/css">
.table {
background-color:red;
}
.table td {
background-color:#eeeeee;
}
.now td{
background-color:red;
}
</style>
<script type="text/Javascript">
<!--
window.onload = function () {
order(document.getElementById('tt'),null,"now");
}
/*
@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;i<trs.length;i++) {
trs[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;
}
}
}
//-->
</script>
<body>
<table border="0" cellpadding="0" cellspacing="1" class="table">
<tbody>
<tr >
<td>ID</td>
<td>記錄</td>
</tr>
</tbody>
<tbody id="tt">
<tr >
<td>1</td>
<td>記錄</td>
</tr>
<tr>
<td>2</td>
<td>記錄</td>
</tr>
<tr>
<td>3</td>
<td>記錄</td>
</tr>
<tr>
<td>4</td>
<td>記錄</td>
</tr>
</tbody>
</table>
</body>
</html>

JavaScript技術拖拉表格的JS函數,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 暖暖视频免费高清在线观看 视频 | 99久久久A片无码国产精 | AV无码九九久久 | 国产成人综合在线观看网站 | 少妇久久久久久被弄高潮 | 久久精品电影久久电影大全 | 国产福利视频一区二区 | 国产在线精品亚洲 | 久草色在线 | 亚洲精品国偷拍电影自产在线 | 国产AV无码一二三区视频 | 嫩草亚洲国产精品 | 女王黄金vk | 黄色888| 青青草AV国产精品 | 91夫妻交友论坛 | 超碰在线 视频 | 文中字幕一区二区三区视频播放 | 手机伊在人线香蕉2 | 国产最新地址 | 99热婷婷国产精品综合 | 国产成人免费a在线资源 | 兽交白浆喷水高潮 | 亚洲乱码中文字幕久久孕妇黑人 | 在线AV国产传媒18精品免费 | 在线免费观看毛片网站 | 国产精品久久久久久精品... | 国产人妻人伦精品836700 | 快播av网址 | 亚洲午夜无码久久久久蜜臀av | 把内衣脱了把奶露出来 | 亚洲视频在线观看不卡 | 法国剧丝袜情版h级在线电影 | 青柠在线视频 | 欧洲日韩av无线在码 | 欧美老妇与zozoz0交 | 丰满人妻妇伦又伦精品APP国产 | 国产曰批试看免费视频播放免费 | 俄罗斯videosbest8 | 欧美free嫩交hd | 欧美一级成人影院免费的 |