![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
10/03/2007, 07:56
|
| | Fecha de Ingreso: marzo-2007
Mensajes: 5
Antigüedad: 17 años, 11 meses Puntos: 0 | |
compatibilidad....
Buenas, tengo un problema acerca de la compatibilidad, auque he comprobado que es valido en w3c... he comprobado con iExplorer, y me va perfectamente, aunque hay un fallo, hay que clickar dos veces para que se mueva...pero bueno, y en el firefox no me va!!! con getElementById..., espero vuestra ayuda sobre el porque... muchas gracias.
Y
<-----comienzo html--------------->
<title>Dynamic page</title>
<script language="javascript" type="text/javascript">
<!--
function desplaza(x,y,z)
{
if ( !document.getElementById ) return;
for ( i = 0 ; i < 4 ; i++ )
{
if(document.form1.seleccionado[i].checked)
elementoseleccionado = document.form1.seleccionado[i].value;
}
elemento = document.getElementById(elementoseleccionado);
elemento.style.left = parseInt(elemento.style.left) + x;
elemento.style.top = parseInt(elemento.style.top) + y;
elemento.style.zIndex = parseInt(elemento.style.zIndex) + z;
}
-->
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<h1 id="titulo" style="position:absolute; left:10px; top:10px; visibility:visible; z-index:0; height:10px; width:440px">
Titulo de la página
</h1>
<div id="tabla1" style="position:absolute; left:10px; top:60px; visibility:visible; z-index:0; height:100px; width:200px; background-color:#000099; layer-background-color:#000099; border: 1px none #000000;">
<table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<h2>Tabla 1</h2>
</td>
</tr>
</table>
</div>
<div id="tabla2" style="position:absolute; left:250px; top:60px; visibility:visible; z-index:0; height:100px; width:200px; background-color:#993300; layer-background-color:#993300; border: 1px none #000000;">
<table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<h2>Tabla 2</h2>
</td>
</tr>
</table>
</div>
<div id="tabla3" style="position:absolute; left:10px; top:190px; visibility:visible; z-index:0; background-color:#CCCCCC; layer-background-color:#CCCCCC; border: 1px none #000000;">
<form name="form1" action="">
<table width="440" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="220">
<input type="radio" name="seleccionado" value="titulo" checked="checked" />Titulo<br />
<input type="radio" name="seleccionado" value="tabla1" />Tabla 1<br />
<input type="radio" name="seleccionado" value="tabla2" />Tabla 2<br />
<input type="radio" name="seleccionado" value="tabla3" />Tabla 3<br />
</td>
<td width="220">
<input type="button" value="arriba" onclick="desplaza(0, -20, 0);" /><br />
<input type="button" value="abajo" onclick="desplaza(0, 20, 0);" /><br />
<input type="button" value="izquierda" onclick="desplaza(-20, 0, 0);" /><br />
<input type="button" value="derecha" onclick="desplaza(20, 0, 0);" /><br />
<input type="button" value="mas arriba" onclick="desplaza(0, 0, 1);" /><br />
<input type="button" value="mas abajo" onclick="desplaza(0, 0, -1);" /><br />
</td>
</tr>
</table>
</form>
</div>
</body>
</html>
<---------fin html--------->
thanks!
Love W3C!!! |