Foros del Web » Programando para Internet » Javascript »

Cambiar la imagen del boton de un grupo de links

Estas en el tema de Cambiar la imagen del boton de un grupo de links en el foro de Javascript en Foros del Web. Veran, cuando se pone un solo link con cambio de imagen en una pagina html, todo funciona muy bien, y el script trabaja bien. Pero ...
  #1 (permalink)  
Antiguo 24/12/2004, 02:34
 
Fecha de Ingreso: julio-2004
Mensajes: 194
Antigüedad: 19 años, 9 meses
Puntos: 0
Cambiar la imagen del boton de un grupo de links

Veran, cuando se pone un solo link con cambio de imagen en una pagina html, todo funciona muy bien, y el script trabaja bien.

Pero cuando pones un grupo de links con cambio de imagen en una pagina html, el script se traba, y deja de funcionar el cambio de imagen.

Prueben aislando un link con cambio de imagen, y van a ver que funciona perfectamente. Pero cuando pones todos los links con cambio de imagen, el script deja de funcionar, y la pregunta es porque???




<html>
<head>

<body bgcolor="black">

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<center>
<a href="http://www.motorola.com/mx" target="_blank"
onMouseOver="document.the_image.src='http://www.tonamelt.com/Publicidad/playstation-go.GIF';"
onMouseOut="document.the_image.src='http://www.tonamelt.com/Publicidad/playstation.gif';">
<img src="http://www.tonamelt.com/Publicidad/playstation.gif" name="the_image" border="0">
</center>

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<center>
<a href="http://www.motorola.com/mx" target="_blank"
onMouseOver="document.the_image.src='http://www.tonamelt.com/Publicidad/cineapolis-go.GIF';"
onMouseOut="document.the_image.src='http://www.tonamelt.com/Publicidad/cinepolis.gif';">
<img src="http://www.tonamelt.com/Publicidad/cinepolis.gif" name="the_image" border="0">
</center>

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<center>
<a href="http://www.motorola.com/mx" target="_blank"
onMouseOver="document.the_image.src='http://www.tonamelt.com/Publicidad/aiwa-go.GIF';"
onMouseOut="document.the_image.src='http://www.tonamelt.com/Publicidad/aiwa.gif';">
<img src="http://www.tonamelt.com/Publicidad/aiwa.gif" name="the_image" border="0">
</center>

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<center>
<a href="http://www.motorola.com/mx" target="_blank"
onMouseOver="document.the_image.src='http://www.tonamelt.com/Publicidad/motorola-go.GIF';"
onMouseOut="document.the_image.src='http://www.tonamelt.com/Publicidad/motorola.gif';">
<img src="http://www.tonamelt.com/Publicidad/motorola.gif" name="the_image" border="0">
</center>

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<center>
<a href="http://www.motorola.com/mx" target="_blank"
onMouseOver="document.the_image.src='http://www.tonamelt.com/Publicidad/mixup-go.JPG';"
onMouseOut="document.the_image.src='http://www.tonamelt.com/Publicidad/mixup.JPG';">
<img src="http://www.tonamelt.com/Publicidad/mixup.JPG" name="the_image" border="0">
</center>

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

</body>
</html>
  #2 (permalink)  
Antiguo 24/12/2004, 04:01
Avatar de JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 22 años, 2 meses
Puntos: 772
Hola Alex Cruz

Has puesto a todas las imágenes el mismo nombre. Prueba poniendo nombres distintos.

Saludos,
  #3 (permalink)  
Antiguo 24/12/2004, 17:48
 
Fecha de Ingreso: julio-2004
Mensajes: 194
Antigüedad: 19 años, 9 meses
Puntos: 0
Hola Javier, gracias por responder. Pero ya intente cambiar de nombre la imagen, incluso las numere para diferenciarlas, pero no jala el script.

Incluso cuando cambias el name="the_image", el script no funciona para una sola imagen del link. No entiendo porque solo funciona en el caso de un solo link con cambio de imagen???




<html>
<head>

<body bgcolor="black">

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<center>
<a href="http://www.motorola.com/mx" target="_blank"
onMouseOver="document.the_image.src='http://www.tonamelt.com/Publicidad/playstation-go.GIF';"
onMouseOut="document.the_image.src='http://www.tonamelt.com/Publicidad/playstation.gif';">
<img src="http://www.tonamelt.com/Publicidad/playstation.gif" name="the_image1" border="0">
</center>

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<center>
<a href="http://www.motorola.com/mx" target="_blank"
onMouseOver="document.the_image.src='http://www.tonamelt.com/Publicidad/cineapolis-go.GIF';"
onMouseOut="document.the_image.src='http://www.tonamelt.com/Publicidad/cinepolis.gif';">
<img src="http://www.tonamelt.com/Publicidad/cinepolis.gif" name="the_image2" border="0">
</center>

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<center>
<a href="http://www.motorola.com/mx" target="_blank"
onMouseOver="document.the_image.src='http://www.tonamelt.com/Publicidad/aiwa-go.GIF';"
onMouseOut="document.the_image.src='http://www.tonamelt.com/Publicidad/aiwa.gif';">
<img src="http://www.tonamelt.com/Publicidad/aiwa.gif" name="the_image3" border="0">
</center>

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<center>
<a href="http://www.motorola.com/mx" target="_blank"
onMouseOver="document.the_image.src='http://www.tonamelt.com/Publicidad/motorola-go.GIF';"
onMouseOut="document.the_image.src='http://www.tonamelt.com/Publicidad/motorola.gif';">
<img src="http://www.tonamelt.com/Publicidad/motorola.gif" name="the_image4" border="0">
</center>

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<center>
<a href="http://www.motorola.com/mx" target="_blank"
onMouseOver="document.the_image.src='http://www.tonamelt.com/Publicidad/mixup-go.JPG';"
onMouseOut="document.the_image.src='http://www.tonamelt.com/Publicidad/mixup.JPG';">
<img src="http://www.tonamelt.com/Publicidad/mixup.JPG" name="the_image5" border="0">
</center>

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>


</TABLE>
</body>
</html>
  #4 (permalink)  
Antiguo 25/12/2004, 03:54
Avatar de JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 22 años, 2 meses
Puntos: 772
Hola de nuevo.

Has cambiado el nombre de la imágen name="the_image1" pero ahora tienes que cambiarlo también en los evento onmouseover y onmouseout

onMouseOver="document.the_image1.src='http://www.tonamelt.

Espero que te funcione. Saludos,
  #5 (permalink)  
Antiguo 27/12/2004, 22:31
 
Fecha de Ingreso: julio-2004
Mensajes: 194
Antigüedad: 19 años, 9 meses
Puntos: 0
Hola Javier, gracias por responder la duda.

Tienes toda la razon, el problema era numerar los eventos "onMouseOver" y "onMouseOut", o llamarlos de diferente forma. Thanks!!!

Ahi les dejo este util javascript para link de publicidad, por eso aportar scripts y compartir en el foro, saludos!!!

-------------------------

<html>
<head>

<body bgcolor="black">

<br>
<br>
<br>
<br>

<center>
<a href="http://www.playstation.com" target="_blank"
onMouseOver="document.the_image1.src='http://www.tonamelt.com/Publicidad/playstation-go.GIF';"
onMouseOut="document.the_image1.src='http://www.tonamelt.com/Publicidad/playstation.gif';">
<img src="http://www.tonamelt.com/Publicidad/playstation.gif" name="the_image1" border="0" hspace="4" vspace="4">
</center>

<br>
<br>
<br>
<br>

<center>
<a href="http://www.cinepolis.com.mx" target="_blank"
onMouseOver="document.the_image2.src='http://www.tonamelt.com/Publicidad/cineapolis-go.GIF';"
onMouseOut="document.the_image2.src='http://www.tonamelt.com/Publicidad/cinepolis.gif';">
<img src="http://www.tonamelt.com/Publicidad/cinepolis.gif" name="the_image2" border="0" hspace="4" vspace="4">
</center>


<br>
<br>
<br>
<br>

<center>
<a href="http://www.latin.aiwa.com/mx/" target="_blank"
onMouseOver="document.the_image3.src='http://www.tonamelt.com/Publicidad/aiwa-go.GIF';"
onMouseOut="document.the_image3.src='http://www.tonamelt.com/Publicidad/aiwa.gif';">
<img src="http://www.tonamelt.com/Publicidad/aiwa.gif" name="the_image3" border="0" hspace="4" vspace="4">
</center>


<br>
<br>
<br>
<br>

<center>
<a href="http://www.motorola.com/mx" target="_blank"
onMouseOver="document.the_image4.src='http://www.tonamelt.com/Publicidad/motorola-go.GIF';"
onMouseOut="document.the_image4.src='http://www.tonamelt.com/Publicidad/motorola.gif';">
<img src="http://www.tonamelt.com/Publicidad/motorola.gif" name="the_image4" border="0" hspace="4" vspace="4">
</center>


<br>
<br>
<br>
<br>


<center>
<a href="http://www.mixup.com.mx/mixup/" target="_blank"
onMouseOver="document.the_image5.src='http://www.tonamelt.com/Publicidad/mixup-go.GIF';"
onMouseOut="document.the_image5.src='http://www.tonamelt.com/Publicidad/mixup.JPG';">
<img src="http://www.tonamelt.com/Publicidad/mixup.JPG" name="the_image5" border="0" hspace="4" vspace="4">
</center>


<br>
<br>
<br>
<br>

</body>
</html>
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 16:06.