请教 html中div标签的问题。谢谢。0
mqhcn2013.08.15浏览34次分享举报
.backColor {
background-color: #00FFFF;
cursor:move;
}
.size {
left: 100px;
top: 100px;
line-height: normal;
position:absolute;
float: left;
height: 100px;
width: 100px;
border: 1px solid #000000;
z-index: 1;
}
.size1{
height: 100px;
width: 100px;
}
function getLocation(id,obj){
var div = document.getElementById("div"+id);
//alert(event.srcElement.style.top);
alert(div.style.left);
alert(this.style.left)
}
点击拖动我
这里显示内容
以上是代码,小弟,请教的问题是,
1,this 表示什么?this不是就是div1的意思么··,为什么第二个alert会报错?
2,alert(div.style.left); 为什么啥也显示不出来?
3,我的onmousedown为什么是在我点击“点击拖动我”触发的。
谢谢大侠~