摘要: js:var isDrag = 0;var divMove; var divAndMouseX;//鼠标落点距离div左上角x坐标的差距 var divAndMouseY;//鼠标落点距离div左上角y坐标的差距 function down(div) { isDrag = 1; divMove = div; divAndMouseX = event.clientX - parseInt(document.getElementById(div).offsetLeft); divAndMouseY = event.clientY - parseInt(document.getElementById 阅读全文
posted @ 2012-08-01 15:52 Uoolo 阅读(903) 评论(0) 推荐(0) 编辑
摘要: javascript:document.getElementById("id").focus();或javascript:document.all.id.focus();或javascript:document.all.name.focus();例子:<input type="text" name="tt" id="tt"> <input type="button" name="bt" id="bt" onclick="java 阅读全文
posted @ 2012-08-01 15:36 Uoolo 阅读(4175) 评论(0) 推荐(0) 编辑
摘要: var docWidth = document.body.offsetWidth; // var docHeight = document.body.offsetHeight; var divobj = document.getElementById("align"); var divWidth = divobj.offsetWidth; // var divHeight = divobj.offsetHeight; //让图片左右居中显示 var marginleft=(docWidth-divWidth)/2; divobj.style.marginLeft = mar 阅读全文
posted @ 2012-08-01 15:33 Uoolo 阅读(669) 评论(0) 推荐(0) 编辑
摘要: 通过offsetTop获取top值,object.offsetTopobject.style.top不能获取top值,但可以设置top值 阅读全文
posted @ 2012-08-01 15:32 Uoolo 阅读(444) 评论(0) 推荐(0) 编辑
摘要: <SCRIPT LANGUAGE="javascript"> <!-- window.open ('page.html', 'newwindow', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no,resizable=no,location=no, status=no') //写成一行 --> </SCRIPT> 参数解释: <SCRIPT LANGUAGE="javas 阅读全文
posted @ 2012-08-01 15:27 Uoolo 阅读(248) 评论(0) 推荐(0) 编辑