为什么不能移动到右下角
我想实现点击里面的框框就移动到外面框框的右下角。。。
但是不知道什么原因,居然不能移动过去、。。
谢谢
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML> <HEAD> <TITLE> New Document </TITLE> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author" CONTENT=""> <META NAME="Keywords" CONTENT=""> <META NAME="Description" CONTENT=""> <style type="text/css">#contentofnote { position: relative; border: 1px dashed; height: 50px; width: 50px;}#bottomrighttcorner { position: absolute; left: 0px; top: 0px; font-size: 0; cursor: se-resize; height: 7px; width: 7px; border: 1px solid; background-color: #fff;}</style><script type="text/javascript">function $(id) {return document.getElementById(id);}function updateCorner(e) { e = e || window.event; var br = $("bottomrighttcorner"); var contentofnote = $("contentofnote"); var height = contentofnote.offsetHeight; var width = contentofnote.offsetWidth; var cornerHeight = br.offsetHeight; var cornerWidth = br.offsetWidth; with (br.style) { left = width - cornerWidth + "px"; top = height - cornerHeight + "px"; }//这里如果是常量那就正常。。但是变量我看过值是没错的。。}</script> </HEAD> <BODY> <div id="contentofnote"> <div id="bottomrighttcorner" onmousedown="updateCorner(event);"> </div> </div> </BODY></HTML>
</div>
</BODY>
</HTML>