关于div层的问题

来源:百度知道 编辑:UC知道 时间:2024/05/30 07:00:08
在页面里有个div层.希望可以用鼠标随意拖放这个层的大小.
我以前见过一个类似的.就是在div里加了个属性就可以了.可是这个属性我忘记是什么了.有知道的吗

<body contenteditable=true>
<div style="border:1px solid #3366cc;width:80px;height:80px">可以拖动大小的DIV</div>
</body>

<HTML>
<HEAD>
<TITLE>Editing events sample page</TITLE>
<SCRIPT>
// Turn on 2D positioning
document.execCommand("2D-position",false,true);
// Fires when the onmovestart event is fired
function fnHandleMoveStart() {
var oDiv = event.srcElement
oDiv.style.backgroundColor = "green";
oDiv.innerText = "I Started Moving";
}
// Function called when the onmoveend event is fired
function fnHandleMoveEnd() {
var oDiv = event.srcElement
oDiv.style.backgroundColor = "red";
oDiv.innerText = "I Stopped";
}
</SCRIPT>
</HEAD>
<BODY onmovestart="fnHandleMoveStart();" onmoveend="fnHandleMoveEnd();"bgcolor="#000000&quo