Ver Mensaje Individual
  #3 (permalink)  
Antiguo 06/08/2009, 11:11
Avatar de sweetlydark
sweetlydark
 
Fecha de Ingreso: septiembre-2008
Mensajes: 391
Antigüedad: 15 años, 7 meses
Puntos: 10
Respuesta: Montar una Imagen

No especificas si quieres reemplazar el imagen de la mesa (con uno de una mesa con el cigarro) o si quieres colocar el nuevo imagen (cigarro solo) sobre el viejo imagen (mesa sola).

Pero esto te debe de ayudar:

Código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Reemplazo - Por encima</title>
<meta name="sweetlydark" content="http://aeinbetween.com/" >
<script>
function Reemplazar(){
	var x=document.getElementById("imagen");
	x.src = "tuImagen2.GIF"; //asumiendo que tu foto esta en el mismo directorio que tu pagina sino coloca su direccion
}

//tomado y modificado de http://stackoverflow.com/questions/226847/what-is-the-best-javascript-code-to-create-an-img-element
function img_create(src, alt, title, id) {
    var img= document.all? new Image() : document.createElement('img');
    img.src= src;
	img.style.position = "absolute"; //para colocar el image por encima
    if (alt!=null) img.alt= alt;
    if (title!=null) img.title= title;
	if (id!=null) img.id = id;
    return img;
}

function PorEncima(){
	var x=document.getElementById("imagen");
	var y=img_create("tuImagen2.GIF", "", "","");
	document.getElementById("divtest").insertBefore(y, x); //si no usas insertBefore el imagen quedara debajo del inicial
}
</script>
</head>
<body > <!--El es necesario para poder usar insertBefore-->
<div id="divtest"><img id="imagen" src="tuImagen.GIF"></div> 
<input type="button" value="Reemplazar" onclick="Reemplazar();">
<input type="button" value="Por Encima" onclick="PorEncima();">
</body>
</html>
__________________
Por fin vuelvo a tener internet!
http://www.anidandoetiquetas.com/