Foros del Web » Programando para Internet » Javascript »

Cambiar title de una imagen

Estas en el tema de Cambiar title de una imagen en el foro de Javascript en Foros del Web. hola para cambiar una imagen utilizo lo siguiente form.NombreImagen.src = "imagen.jpg" me gustaria saber como cambiarle tambien el title he probado con form.NombreImagen.title = "titulo" ...
  #1 (permalink)  
Antiguo 27/11/2010, 15:16
 
Fecha de Ingreso: julio-2002
Mensajes: 61
Antigüedad: 21 años, 9 meses
Puntos: 1
Cambiar title de una imagen

hola

para cambiar una imagen utilizo lo siguiente

form.NombreImagen.src = "imagen.jpg"


me gustaria saber como cambiarle tambien el title
he probado con

form.NombreImagen.title = "titulo"

pero no hace nada

gracias
  #2 (permalink)  
Antiguo 27/11/2010, 16:18
Avatar de caricatos
Moderador
 
Fecha de Ingreso: abril-2002
Ubicación: Torremolinos (Málaga)
Mensajes: 19.607
Antigüedad: 22 años
Puntos: 1284
Respuesta: Cambiar title de una imagen

Hola:

Lo haces de forma correcta... ¿No te estarás confundiendo con el atributo alt...?

Saludos
__________________
Por favor:
No hagan preguntas de temas de foros en mensajes privados... no las respondo
  #3 (permalink)  
Antiguo 27/11/2010, 19:34
 
Fecha de Ingreso: noviembre-2010
Mensajes: 66
Antigüedad: 13 años, 4 meses
Puntos: 0
Respuesta: Cambiar title de una imagen

aqui te dejo el codigo de un album podrias encontrar lo que buscas de ai:

Código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Estilos</title>
<link rel="stylesheet" href="botoninicio.css" type="text/css" media="all">
</head>
<body>
<table border="0" cellpadding="0">
  <tr>
    <td width="100%"><img src="fondos\dux.jpg" width="400" height="264" name="photoslider"></td>
  </tr>
  <tr>
    <td width="100%"><form method="POST" name="rotater">
      <div align="center"><center><p>

<script language="JavaScript1.1">

/*
Photo Slider II- By Kevin Adams ([email protected])
For this script and more
Visit http://www.javascriptkit.com
*/

var photos=new Array()
var text=new Array()
var which=0
var what=0

//Change the below variables to reference your own images. You may have as many images in the slider as you wish
photos[0]="fondos/dux.jpg"
photos[1]="fondos/husky.jpg"
photos[2]="fondos/Lobo.jpg"
photos[3]="fondos/Tigre_Estilo.jpg"
photos[4]="fondos/Resident.jpg"
photos[5]="fondos/El_señor_de_los_anillos.jpg"
photos[6]="fondos/zombie.jpg"
photos[7]="fondos/Assassins.jpg"
photos[8]="fondos/Devil.jpg"
photos[9]="fondos/Call_of_duty.jpg"

//change coresponding description
text[0]="Dux"
text[1]="Husky"
text[2]="Lobo"
text[3]="Tigre"
text[4]="Resident Evil"
text[5]="El señor de los anillos"
text[6]="Zombie"
text[7]="Assassins creed"
text[8]="Devil may cry"
text[9]="Call of duty"

window.onload=new Function("document.rotater.description.value=text[0]")

function backward(){
if (which>0){
window.status=''
which--
document.images.photoslider.src=photos[which];
what--
document.rotater.description.value=text[what];
}
}

function forward(){
if (which<photos.length-1){
which++
document.images.photoslider.src=photos[which]
what++
document.rotater.description.value=text[what];
}
else window.status='End of gallery'
}

function type()
 {
 alert("This textbox will only display default comments")
 }


</script>
<p><input type=text name="description" style="width:400px" size=50>

<p><img src="botones\atras00.png" alt="Atrás" name="B2"
      onClick="backward()"> <img src="botones\siguiente00.png" alt="Siguiente" name="B1"
      onClick="forward()"><br></p>
      </center></div>
    </form>
    </td>
  </tr>
</table>
</body>
</html>
  #4 (permalink)  
Antiguo 28/11/2010, 02:40
 
Fecha de Ingreso: julio-2002
Mensajes: 61
Antigüedad: 21 años, 9 meses
Puntos: 1
Respuesta: Cambiar title de una imagen

Cita:
Iniciado por caricatos Ver Mensaje
Hola:

Lo haces de forma correcta... ¿No te estarás confundiendo con el atributo alt...?

Saludos
efectivamente, gracias caricatos

Etiquetas: title
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 12:51.