求各位大大,一段JS代码修改,求在火狐下能实现拖动层
// JavaScript Documentvar md=false,mobj,ox,oy;
function document.onmousedown(){
if(event.srcElement.forid=="area")
{
md = true;
mobj = document.getElementById(event.srcElement.id);
ox = mobj.offsetLeft - event.x;
oy = mobj.offsetTop - event.y;
}
}
document.onmouseup=function(){md=false;}
function document.onmousemove()
{
if(md)
{
var top = event.y + oy;
window.status = top;
if(!(top < 0 || top > 195)){
mobj.style.top = top;
var step = ((document.getElementById('con').clientHeight*2 - 195) / 500);
document.getElementById('con').style.marginTop = ((0 - top) * step);
}
}
}
在IE下能实现拖动层了,就是火狐下没动静