摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
通过offsetTop获取top值,object.offsetTopobject.style.top不能获取top值,但可以设置top值 阅读全文
摘要:
<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 阅读全文