关于表格拖动的问题 onselectstart="return false"这个就是防止复制 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 onselectstart="return false" 不要直接托表格 ,把表格放在div里,拖动div <html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title> 可以用鼠标拖动的表格 </title></head><body><SCRIPT LANGUAGE="JavaScript"><!--var currentMoveObj = null; //当前拖动对象var relLeft; //鼠标按下位置相对对象位置var relTop;function f_mdown(obj){if(event.srcElement.id=="id1"){ currentMoveObj = obj; //当对象被按下时,记录该对象 currentMoveObj.style.position = "absolute"; relLeft = event.x - currentMoveObj.style.pixelLeft; relTop = event.y - currentMoveObj.style.pixelTop;}}window.document.onmouseup = function(){ currentMoveObj = null; //当鼠标释放时同时释放拖动对象}function f_move(obj){ if(currentMoveObj != null) { currentMoveObj.style.pixelLeft=event.x-relLeft; currentMoveObj.style.pixelTop=event.y-relTop; }}//--></SCRIPT><BODY><TABLE width="100" border=1 style="position:absolute;left:50;top:50" onmousedown="f_mdown(this)" onmousemove="f_move(this)"><TR> <TD bgcolor="#CCCCCC" align="center" style="cursor:move" id="id1"> title1 </TD></TR><TR> <TD align="center" height="60" id="id2"> content </TD></TR></TABLE></body></html> 1楼所说的,把table的onselectstart="return false"删除掉就可以了 为什么在不管是div或table 在拖动时,如果是速度过快,鼠标就会脱离拖动体。这个怎么解决? Extjs treePanel 节点默认选中 关键词查询,弹出结果窗口,背景变暗,很急用! 如果给img加链接 apply的疑问 菜鸟的问题:如何用javascript改变表单的action属性? 100分送, 数组长度引用和控件名冲突的问题 如何能让document.write语句写出的代码调用ASP?如代码调用<%=rs("data")%> 日期比较问题!在线等待! js 异步 阻止提交表单 谁有双色球走势图的代码 js写的 JS写入COOKIES,值不能重复 关于insertAdjacentElement跨浏览器问题
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title> 可以用鼠标拖动的表格 </title>
</head><body>
<SCRIPT LANGUAGE="JavaScript">
<!--
var currentMoveObj = null; //当前拖动对象
var relLeft; //鼠标按下位置相对对象位置
var relTop;
function f_mdown(obj)
{
if(event.srcElement.id=="id1")
{
currentMoveObj = obj; //当对象被按下时,记录该对象
currentMoveObj.style.position = "absolute";
relLeft = event.x - currentMoveObj.style.pixelLeft;
relTop = event.y - currentMoveObj.style.pixelTop;
}
}
window.document.onmouseup = function()
{
currentMoveObj = null; //当鼠标释放时同时释放拖动对象
}
function f_move(obj)
{
if(currentMoveObj != null)
{
currentMoveObj.style.pixelLeft=event.x-relLeft;
currentMoveObj.style.pixelTop=event.y-relTop;
}
}//-->
</SCRIPT>
<BODY>
<TABLE width="100" border=1 style="position:absolute;left:50;top:50" onmousedown="f_mdown(this)" onmousemove="f_move(this)">
<TR>
<TD bgcolor="#CCCCCC" align="center" style="cursor:move" id="id1"> title1 </TD>
</TR>
<TR>
<TD align="center" height="60" id="id2"> content </TD>
</TR>
</TABLE>
</body></html>
这个怎么解决?