类似3721里的可拖动图层如何做(可以保存拖动位置) http://jkisjk.spaces.live.com/blog/cns!758CACE25E89DD3B!358.entry 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这是一个可移动table的例子,希望对你有用<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>JK:支持民族工业,尽量少买X货</title><style>.removableObj{height:25;position:relative;}</style><script language="javascript">var beginMoving=false;var sourceObj=null;var objectObj=null;var objectObj2=null;function MouseDownToMove(obj){obj.style.zIndex=1;obj.mouseDownY=event.clientY;obj.mouseDownX=event.clientX;beginMoving=true;obj.setCapture();sourceObj=obj;objectObj=null;}function MouseMoveToMove(obj){if(!beginMoving) return false;obj.style.top = (event.clientY-obj.mouseDownY);obj.style.left = (event.clientX-obj.mouseDownX);}function MouseUpToMove(obj){if(!beginMoving) return false;obj.releaseCapture();obj.style.top=0;obj.style.left=0;obj.style.zIndex=0;beginMoving=false;window.setTimeout("swapFun()",20);}function MouseOverFun(obj){if(obj==sourceObj) return false;objectObj=obj;}function MouseOverFun2(obj){objectObj2=obj;}function swapFun(){if(sourceObj!=null && objectObj!=null) objectObj.insertAdjacentElement("beforeBegin",sourceObj);else if(sourceObj!=null && objectObj2!=null) objectObj2.insertAdjacentElement("beforeEnd",sourceObj);sourceObj=null;objectObj=null;objectObj2=null;}</script></head><body><table border="1" width="100%" height="58"><tr><td width="34%" valign="top" height="46" onmouseover="MouseOverFun2(this);" ><table border="1" width="100%" bgcolor="#99CCFF" class="removableObj" onmousedown='MouseDownToMove(this)' onmousemove='MouseMoveToMove(this)' onmouseup='MouseUpToMove(this);' onmouseover="MouseOverFun(this);" ><tr><td width="23%">和</td><td width="21%">飞过海</td></tr><tr><td width="23%"> </td><td width="21%"> </td></tr></table><table border="1" width="100%" bgcolor="#FFCCFF" class="removableObj" onmousedown='MouseDownToMove(this)' onmousemove='MouseMoveToMove(this)' onmouseup='MouseUpToMove(this);' onmouseover="MouseOverFun(this);" ><tr><td width="21%">还是</td><td width="35%">护身符哈</td></tr><tr><td width="21%">,</td><td width="35%">和是是护</td></tr></table><table border="1" width="100%" bgcolor="#00CC99" class="removableObj" onmousedown='MouseDownToMove(this)' onmousemove='MouseMoveToMove(this)' onmouseup='MouseUpToMove(this);' onmouseover="MouseOverFun(this);" ><tr><td width="21%">还是</td><td width="9%"> </td><td width="35%">呵呵</td></tr><tr><td width="21%">,</td><td width="9%"> </td><td width="35%">和</td></tr></table></td><td width="32%" valign="top" height="52" onmouseover="MouseOverFun2(this);" ><table border="1" width="100%" bgcolor="#FF0000" class="removableObj" onmousedown='MouseDownToMove(this)' onmousemove='MouseMoveToMove(this)' onmouseup='MouseUpToMove(this);' onmouseover="MouseOverFun(this);" ><tr><td width="21%">还是</td></tr><tr><td width="21%">,</td></tr></table> <table border="1" width="100%" bgcolor="#00FFFF" class="removableObj" onmousedown='MouseDownToMove(this)' onmousemove='MouseMoveToMove(this)' onmouseup='MouseUpToMove(this);' onmouseover="MouseOverFun(this);" ><tr><td width="21%">还是</td><td width="35%">护身符哈</td><td width="21%"> </td><td width="23%">呵呵</td></tr><tr><td width="21%">,</td><td width="35%">和是是护</td><td width="21%"> </td><td width="23%">和</td></tr></table></td><td width="34%" valign="top" height="52" onmouseover="MouseOverFun2(this);" ><table border="1" width="100%" bgcolor="#FF9966" class="removableObj" onmousedown='MouseDownToMove(this)' onmousemove='MouseMoveToMove(this)' onmouseup='MouseUpToMove(this);' onmouseover="MouseOverFun(this);" ><tr><td width="21%">还是</td><td width="35%">护身符哈</td><td width="21%"> </td><td width="23%">呵呵</td></tr><tr><td width="21%">,</td><td width="35%">和是是护</td><td width="21%"> </td><td width="23%">和</td></tr></table> <table width="100%" border="1" bgcolor="#FFFFCC" class="removableObj" onmousedown='MouseDownToMove(this)' onmousemove='MouseMoveToMove(this)' onmouseup='MouseUpToMove(this);' onmouseover="MouseOverFun(this);" ><tr><td width="87"> 输多发</td><td width="115">嘎撒递归</td></tr><tr><td width="87">嘎大嘎</td><td width="115">大幅度</td></tr><tr><td width="87">过大撒</td><td width="115">嘎</td></tr></table></td></tr></table></body></html> 今天好运气,老狼请吃鸡!你可以用cookie记录坐标,也可以记录入数据库。 如果只对IE,建议用userData记录在客户端 半瓶水了javascript的cookie取屏幕位置我现在还不会会asp取cookie记录 图层若你已经会拖动了,看这里:http://bbs.blueidea.com/archiver/tid-2677651.html JavaScript怎样连接MySQL数据库? 怎么用鼠标在google map上划一个矩形? 帮助:删除 img 节点 拖动 mouseup 事件的问题 setInterval()+ajax诡异的问题!!!高手帮忙看看!! 请教xml读取数据表返回的数据获取不了是怎么回事??? 乱码+false javaScript 的typeof 是做什么的,麻烦告诉我谢谢 简单问题:网页间的框架如何传值? 如何 点击一张图片将其保存? 疑义相与析(第一期):征集常见问题 如何判断网页中的资源下载是否成功? 有用过阿赖树控件的么?有问题求教
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>JK:支持民族工业,尽量少买X货</title>
<style>
.removableObj
{
height:25;position:relative;
}
</style>
<script language="javascript">
var beginMoving=false;
var sourceObj=null;
var objectObj=null;
var objectObj2=null;
function MouseDownToMove(obj){
obj.style.zIndex=1;
obj.mouseDownY=event.clientY;
obj.mouseDownX=event.clientX;
beginMoving=true;
obj.setCapture();
sourceObj=obj;
objectObj=null;
}function MouseMoveToMove(obj){
if(!beginMoving) return false;
obj.style.top = (event.clientY-obj.mouseDownY);
obj.style.left = (event.clientX-obj.mouseDownX);
}
function MouseUpToMove(obj){
if(!beginMoving) return false;
obj.releaseCapture();
obj.style.top=0;
obj.style.left=0;
obj.style.zIndex=0;
beginMoving=false;
window.setTimeout("swapFun()",20);
}function MouseOverFun(obj)
{
if(obj==sourceObj) return false;
objectObj=obj;
}function MouseOverFun2(obj)
{
objectObj2=obj;
}function swapFun()
{
if(sourceObj!=null && objectObj!=null) objectObj.insertAdjacentElement("beforeBegin",sourceObj);
else if(sourceObj!=null && objectObj2!=null) objectObj2.insertAdjacentElement("beforeEnd",sourceObj);
sourceObj=null;
objectObj=null;
objectObj2=null;
}
</script>
</head><body><table border="1" width="100%" height="58">
<tr>
<td width="34%" valign="top" height="46" onmouseover="MouseOverFun2(this);" >
<table border="1" width="100%" bgcolor="#99CCFF" class="removableObj" onmousedown='MouseDownToMove(this)' onmousemove='MouseMoveToMove(this)' onmouseup='MouseUpToMove(this);' onmouseover="MouseOverFun(this);" >
<tr>
<td width="23%">和</td>
<td width="21%">飞过海</td>
</tr>
<tr>
<td width="23%"> </td>
<td width="21%"> </td>
</tr>
</table><table border="1" width="100%" bgcolor="#FFCCFF" class="removableObj" onmousedown='MouseDownToMove(this)' onmousemove='MouseMoveToMove(this)' onmouseup='MouseUpToMove(this);' onmouseover="MouseOverFun(this);" >
<tr>
<td width="21%">还是</td>
<td width="35%">护身符哈</td>
</tr>
<tr>
<td width="21%">,</td>
<td width="35%">和是是护</td>
</tr>
</table>
<table border="1" width="100%" bgcolor="#00CC99" class="removableObj" onmousedown='MouseDownToMove(this)' onmousemove='MouseMoveToMove(this)' onmouseup='MouseUpToMove(this);' onmouseover="MouseOverFun(this);" >
<tr>
<td width="21%">还是</td>
<td width="9%"> </td>
<td width="35%">呵呵</td>
</tr>
<tr>
<td width="21%">,</td>
<td width="9%"> </td>
<td width="35%">和</td>
</tr>
</table></td>
<td width="32%" valign="top" height="52" onmouseover="MouseOverFun2(this);" >
<table border="1" width="100%" bgcolor="#FF0000" class="removableObj" onmousedown='MouseDownToMove(this)' onmousemove='MouseMoveToMove(this)' onmouseup='MouseUpToMove(this);' onmouseover="MouseOverFun(this);" >
<tr>
<td width="21%">还是</td>
</tr>
<tr>
<td width="21%">,</td>
</tr>
</table>
<table border="1" width="100%" bgcolor="#00FFFF" class="removableObj" onmousedown='MouseDownToMove(this)' onmousemove='MouseMoveToMove(this)' onmouseup='MouseUpToMove(this);' onmouseover="MouseOverFun(this);" >
<tr>
<td width="21%">还是</td>
<td width="35%">护身符哈</td>
<td width="21%"> </td>
<td width="23%">呵呵</td>
</tr>
<tr>
<td width="21%">,</td>
<td width="35%">和是是护</td>
<td width="21%"> </td>
<td width="23%">和</td>
</tr>
</table></td>
<td width="34%" valign="top" height="52" onmouseover="MouseOverFun2(this);" >
<table border="1" width="100%" bgcolor="#FF9966" class="removableObj" onmousedown='MouseDownToMove(this)' onmousemove='MouseMoveToMove(this)' onmouseup='MouseUpToMove(this);' onmouseover="MouseOverFun(this);" >
<tr>
<td width="21%">还是</td>
<td width="35%">护身符哈</td>
<td width="21%"> </td>
<td width="23%">呵呵</td>
</tr>
<tr>
<td width="21%">,</td>
<td width="35%">和是是护</td>
<td width="21%"> </td>
<td width="23%">和</td>
</tr>
</table>
<table width="100%" border="1" bgcolor="#FFFFCC" class="removableObj" onmousedown='MouseDownToMove(this)' onmousemove='MouseMoveToMove(this)' onmouseup='MouseUpToMove(this);' onmouseover="MouseOverFun(this);" >
<tr>
<td width="87"> 输多发</td>
<td width="115">嘎撒递归</td>
</tr>
<tr>
<td width="87">嘎大嘎</td>
<td width="115">大幅度</td>
</tr>
<tr>
<td width="87">过大撒</td>
<td width="115">嘎</td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
如果只对IE,建议用userData记录在客户端
会asp取cookie记录