有问题啊,不过以前就看到有了!
解决方案 »
- servlet中的空指针报告 rs.next()
- 右下角提示框如何同时播放声音
- 请教《javascript语言精粹》一书中关于sort函数的一个问题
- js不能 submit
- 请问如何用JS取得文本框的值!
- 请问CSDN论坛左边的树状结构图是怎么做的,有源代码最好!高分相送。
- 有关联动菜单的问题
- document.all("currentLocation").style.display="none";
- 请问如何才能得到<span id="rendo">hello!</span>中的值?等待中......
- 页面进入时的特效————渐变,从无到有,不会做
- 没解决的问题,有人在吗?
- 高分求救jscript高手!
<!--
/*
-- Author: Harry
-- Date: 03/22/2005
*/
var Drag = false; // true时为鼠标状态为拖动时
var Drop = false; // true时为鼠标状态为放置被拖动的单元格时
var r = 10; // 表格的行数
var c = 10; // 表格的列数
var cWidth = 25; // 单元格的宽度
var tdObj = null;
var arrColor = ["aliceblue","antiquewhite","aquamarine","beige","burlywood","cadetblue","chocolate","cornsilk","cyan","darkmagenta","darksalmon","darkorange"];
document.onmousedown = function(){
if(event.srcElement.tagName == "TD"){
Drag = true;
tdObj = event.srcElement;
tdObj.style.zIndex=1;
tdObj.mouseDownY=event.clientY;
tdObj.mouseDownX=event.clientX;
tdObj.setCapture();
}
}
document.onmousemove = function (){
if(Drag){
tdObj.style.top = (event.clientY- tdObj.mouseDownY);
tdObj.style.left = (event.clientX- tdObj.mouseDownX);
}
if(Drop){
Drop = false;
var s1 = tdObj.innerText;
var b1 = tdObj.bgColor;
var s2 = event.srcElement.innerText;
var b2 = event.srcElement.bgColor;
tdObj.innerText = s2;
tdObj.bgColor = b2;
event.srcElement.innerText = s1;
event.srcElement.bgColor = b1;
}
}
document.onmouseup = function(){
Drag = false; Drop = true;
tdObj.releaseCapture();
tdObj.style.top=0;
tdObj.style.left=0;
tdObj.style.zIndex=0;
}
//-->
</SCRIPT>
<div id="d" style="position:absolute;display:none;z-index:2"></div>
<SCRIPT LANGUAGE="JavaScript">
<!--
function load(){
fCreateTable(true);
}
function fCreateTable(flag){
var tb = document.createElement("table");
tb.cellPadding = "0";
tb.cellSpacing = "0";
tb.border = "1px solid #cccccc";
if(flag) tb.id = "myTb1";else tb.id = "myTb0";
for(var i=0;i<r;i++){
var row = tb.insertRow(i);
for(var j=0;j<c;j++){
var cell = row.insertCell(j)
if(flag) cell.innerText = i*c+j;else cell.innerHTML = " ";
cell.style.width = cWidth + "px";
cell.style.height = cWidth + "px";
cell.style.position = "relative";
cell.bgColor = arrColor[Math.round(Math.random()*(arrColor.length-1))]
//cell.style.border = "1px solid #cccccc"
}
}
document.body.appendChild(tb);
}
//-->
</SCRIPT>
<body onload="load()" onselectstart="return false" style="cursor:pointer;">
</body>