document.layers no existe mas que en Netscape. No lo probé en mozilla, ya me puedes perdonar.
Creo que me he cargado ahora que funcione en Netscape, no lo tengo instalado en esta máquina. Si puedes probarlo me dices. Funciona en Firefox 1.0.6 y en Opera 8.1 (en IE6 tambien).
Código PHP:
<html>
<head>
<title>Pag1</title>
<style>
.elemento li{
position: absolute;
left:55px;
width:300px;
float:left;
clear:both;
cursor:move;
padding:2px;
border: 1px solid #ccc;
background-color: #eee;
list-style-type: none;
}
</style>
</head>
<body>
<script LANGUAGE="JavaScript">
/* DRAG & DROP */
// Original: Randy Bennett ([email protected])
// Web Site: http://home.thezone.net/~rbennett/sitemap.htm
// (modificado)
N = (document.all) ? 0 : 1;
var ob,X,Y;
document.onmousedown=function(e) {
if (N) {
ob = document.getElementById(e.target.id).style;
Y=e.clientY-parseInt(ob.top);
}
else {
ob = event.srcElement.style;
Y=event.offsetY;
}
return false;
}
document.onmousemove=function(e) {
if (ob) {
if (N)
ob.top=(e.clientY-Y)+"px";
else
ob.pixelTop = (event.clientY-Y+document.body.scrollTop);
return false;
}
}
document.onmouseup=function() {
ob = null;
}
if (N)
document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP);
</script>
<ul class="elemento">
<li id="uno" style="top:5px;">uno</li>
<li id="dos" style="top:30px;">dos</li>
<li id="tres" style="top:55px;">tres</li>
<li id="cuatro" style="top:80px;">cuatro</li>
<li id="cinco" style="top:105px;">cinco</li>
<li id="seis" style="top:130px;">seis</li>
</ul>
</body>
</html>
Ademas le he quitado los puntos de la lista, que me parecia que quedaban feos ;P
A ver si funciona en Netscape..