这个div是另一个div的子节点
position:absolute;top:xx;left:xx
拖动的时候只改变width/height
position:absolute;top:xx;left:xx
拖动的时候只改变width/height
解决方案 »
- easyui layout 布局问题
- javascript函数中参数是中文出错
- 执行exe文件这样写怎么有错呢?
- showModalDialog 获得父窗口节点内容 除了把window作为参数传进去,不传的话是否可以通过其他方式得到 就像open用opener得到。谢谢
- 谁能介绍几本学习javascript比较好的书?
- 【【【有个问题需要大家的帮忙!!!!】】】
- 一个字符串处理的问题
- 在页面中引入ocx控件,怎么在其它页面调用它的方法呢?
- 题目如下:共有三个下拉框,当第一个下拉框被选重之后,第二个下拉框中的选项随即确立,第三个下拉框中的选项根据第二个下拉框中的值也随
- 遍历对象的方法
- 帮我指正一下怎么改才正确,就这么一点分了,感谢
- 今天看了一个网站的JS ,发现如下代码,是用什么加密码的?
<HEAD>
<style>
.divstyle {width:150px; height:300px; border:1px solid green; background-color:#EEEEEE;}
</style>
<script>
function init(){
var div1=document.getElementById('div1');
var div2=document.getElementById('div2');
div2.style.left=div1.offsetLeft+15; //div2相对于div1的左上角x轴偏移量
div2.style.top=div1.offsetTop+15; //div2相对于div1的左上角y轴偏移量
}
</script>
</head>
<body onload="init()">
<div id="div1" class="divstyle" style="position:absolute; left:50px; top:50px; z-index:1;">层一</div>
<div id="div2" class="divstyle" style="position:relative; z-index:2;">层二</div>
</BODY>
</HTML>
obj.clientLeft
obj.clientTop
obj.offsetLeft
obj.offsetTop
obj.scrollLeft
obj.scrollTopobj.clientWidth
obj.clientHeight
obj.offsetWidth
obj.offsetHeight
obj.scrollWidth
obj.scrollHeightevent.clientX
event.clientY
event.offsetX
event.offsetY
event.screenX
event.screenYscreen.width
screen.height
screen.availHeight
screen.availWidth