![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
30/12/2002, 08:07
|
![Avatar de tunait](http://static.forosdelweb.com/customavatars/avatar3543_1.gif) | Moderadora | | Fecha de Ingreso: agosto-2001 Ubicación: Terok Nor
Mensajes: 16.805
Antigüedad: 23 años, 5 meses Puntos: 381 | |
Hola de nuevo,
he probado a pedirle que escriba los valores directamente en lugar de guardarlos todos dentro de una variable y luego escribirla y la verdad es que el tiempo de carga se ha mejorado enormemente (al menos en mi compu). Me carga en aprox. 10 segundos. Lo curioso es que me sale la advertencia de que la ejecución de comandos blablá puede enlentecer internet explorer que si deseo continuar. Pero le dices que "pos claro!" y en breve tienes la tabla cargada.
<html>
<head>
<style>
td {
height:6;
width:2;
cursor:crosshair;
}
</style>
<script language="javascript">
var h = "0123456789ABCDEF";
function hexa(n) {
if (n < 16) return "0" + h.charAt(n);
else return (h.charAt(n / 16) + h.charAt(n % 16));
}
function rgb(r, g, b) {
return "#" + hexa(r) + hexa(g) + hexa(b);
}
function mostrar(color) {
document.colores.selec.value = color;
document.getElementById("muestra").style.backgroun dColor = color;
}
</script>
</head>
<body>
<script language="javascript">
document.write("<table cellpadding=0 cellspacing=0>");
for (var i = 0; i < 256; i = i + 16) {
document.write ("<tr>");
for (var j = 0; j < 256; j = j + 16)
for (var k = 0; k < 256; k = k + 16) {
document.write ("<td onmousemove='mostrar(rgb(" + i + ", " + j + ", " + k + "))'");
document.write (" onclick='alert(\"" + rgb(i, j, k) + "\")'");
document.write (" style='background-color:" + rgb(i, j, k) + "' ></td>");
}
document.write ("</tr>");
}
document.write ("</table>");
//document.write(tabla);
</script>
<br><hr><br>
<form name=colores >
selección actual: <input type=text name=selec value="" \>
</form>
<div id=muestra style="background-color:#000000;border:solid;width:40;height:14">
</body>
</html> |