Foros del Web » Programando para Internet » Javascript »

resaltar texto en una lista

Estas en el tema de resaltar texto en una lista en el foro de Javascript en Foros del Web. buenas tengo un mapa y al lado un listado con las ciudades, y quiero que al ponerse encima de la ciudad me resalte la ciudad ...
  #1 (permalink)  
Antiguo 02/12/2009, 05:15
 
Fecha de Ingreso: noviembre-2009
Mensajes: 209
Antigüedad: 14 años, 5 meses
Puntos: 0
resaltar texto en una lista

buenas tengo un mapa y al lado un listado con las ciudades, y quiero que al ponerse encima de la ciudad me resalte la ciudad seleccionada en la lista.
tengo el siguiente codigo pero no me funciona,
gracias

<script language="JavaScript" type="text/JavaScript">
function resalta(ciudad) {
ciudad = document.getElementById(ciudad+"_lista");
if (ciudad) { ciudad.style.color = "#FF0000"; }
}
</script>
</head>

<body background="../../imagenes/FondoderechaMuseos.png">
<div id="Layer1" style="position:absolute; left:100px; top:51px; width:418px; height:520px; z-index:1" align="center"><img src="http://www.forosdelweb.com/imagenes/mapas/MapaMuseosgral.jpg" width="418" height="520" border="0" usemap="#Map">
<map name="Map">
<area shape="rect" id="castejon" coords="220,66,327,82" href="navarra/castejon.htm" target="mainFrame">
<area shape="rect" id="leukade" coords="32,108,180,122" href="larioja/aquilar.htm" target="mainFrame">
<area shape="rect" id="numancia" coords="13,133,123,146" href="castillaleon/garray.htm" target="mainFrame" onMouseOver="resalta(numancia)">
</map>
</div>
<div id="castejon_lista" style="position:absolute; left:566px; top:61px; width:110px; height:28px; z-index:2"><font color="#FFCC66">Castej&oacute;n</font></div>
<div id="leukade_lista" style="position:absolute; left:569px; top:105px; width:107px; height:25px; z-index:3"><font color="#FFCC66">Leukade</font></div>
<div id="numancia_lista" style="position:absolute; left:570px; top:141px; width:98px; height:31px; z-index:4"><font color="#FFCC66">Numancia</font></div>
</body>
</html>
  #2 (permalink)  
Antiguo 02/12/2009, 05:56
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Sabadell
Mensajes: 4.897
Antigüedad: 16 años, 1 mes
Puntos: 574
Respuesta: resaltar texto en una lista

Código HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Documento sin t&iacute;tulo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><script language="JavaScript" type="text/JavaScript">
function resalta(obj) {
document.getElementById(obj.id+"_lista").style.color = "#FF0000"; 
}
function desresalta(obj) {
document.getElementById(obj.id+"_lista").style.color = "#FFCC66"; 
}
</script>
</head>

<body background="../../imagenes/FondoderechaMuseos.png">
<div id="Layer1" style="position:absolute; left:100px; top:51px; width:418px; height:520px; z-index:1" align="center"><img src="http://www.forosdelweb.com/imagenes/mapas/MapaMuseosgral.jpg" width="418" height="520" border="0" usemap="#Map">
<map name="Map">
<area shape="rect" id="castejon" coords="220,66,327,82" href="navarra/castejon.htm" target="mainFrame" onMouseOver="resalta(this)" onMouseOut="desresalta(this)">
<area shape="rect" id="leukade" coords="32,108,180,122" href="larioja/aquilar.htm" target="mainFrame" onMouseOver="resalta(this)" onMouseOut="desresalta(this)">
<area shape="rect" id="numancia" coords="13,133,123,146" href="castillaleon/garray.htm" target="mainFrame" onMouseOver="resalta(this)" onMouseOut="desresalta(this)">
</map>
</div>
<div id="castejon_lista" style="position:absolute; left:566px; top:61px; width:110px; height:28px; z-index:2;color:#FFCC66">Castej&oacute;n</div>
<div id="leukade_lista" style="position:absolute; left:569px; top:105px; width:107px; height:25px; z-index:3;color:#FFCC66">Leukade</div>
<div id="numancia_lista" style="position:absolute; left:570px; top:141px; width:98px; height:31px; z-index:4;color:#FFCC66">Numancia</div>
</body>
</html> 
que tal así?

Quim
  #3 (permalink)  
Antiguo 02/12/2009, 06:05
 
Fecha de Ingreso: noviembre-2009
Mensajes: 209
Antigüedad: 14 años, 5 meses
Puntos: 0
Respuesta: resaltar texto en una lista

GENIAL!!!!
muchiiiiiiiiiiiiiiiiiisimas gracias quimfv, saludos
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 04:39.