Foros del Web » Programando para Internet » Javascript »

como hago que un dibujito se mueva detras del raton

Estas en el tema de como hago que un dibujito se mueva detras del raton en el foro de Javascript en Foros del Web. alguien me puede decir como pongo un dibujito que se mueba constantemente detras del raton. gracias http://es.geocities.com/eldesvandecasa...
  #1 (permalink)  
Antiguo 11/03/2003, 15:30
Avatar de java444  
Fecha de Ingreso: marzo-2003
Mensajes: 74
Antigüedad: 21 años, 1 mes
Puntos: 0
como hago que un dibujito se mueva detras del raton

alguien me puede decir como pongo un dibujito que se mueba constantemente detras del raton. gracias

http://es.geocities.com/eldesvandecasa
__________________
Asociación Juvenil ISOLE

Última edición por java444; 11/03/2003 a las 15:33
  #2 (permalink)  
Antiguo 11/03/2003, 15:54
Avatar de Artepop  
Fecha de Ingreso: noviembre-2002
Ubicación: Fuengirola
Mensajes: 292
Antigüedad: 21 años, 5 meses
Puntos: 1
Mejor pregunta por el foro de Javascript
Saludos
__________________
http://www.mfo.com.es/
  #3 (permalink)  
Antiguo 11/03/2003, 15:58
Avatar de tunait
Moderadora
 
Fecha de Ingreso: agosto-2001
Ubicación: Terok Nor
Mensajes: 16.805
Antigüedad: 22 años, 8 meses
Puntos: 381
No hace falta, yá lo muevo yo para allá
  #4 (permalink)  
Antiguo 11/03/2003, 19:55
 
Fecha de Ingreso: diciembre-2002
Ubicación: USA
Mensajes: 101
Antigüedad: 21 años, 4 meses
Puntos: 0
Mirate este:
http://www.jsmadeeasy.com/javascript...rail/index.htm

Al principio donde tienes var path =

reemplaza el cursor.gif por el directorio o pagina donde esta la imagen
Código:
<script language="JavaScript1.2">
<!--

var trailLength = 8 // The length of trail (8 by default; put more for longer "tail")
var path = "http://www.jambock.com/phpBB2/images/smiles/new_Eyecrazy.gif" // URL of your image

// do NOT modify anything beyond this point
var isIE = false,isNav = false,range = "all.",style = ".style",i,d = 0
var topPix = ".pixelTop",leftPix = ".pixelLeft",images,storage
if (document.layers) { // browser sniffer
	isNav = true,range = "layers.",style = "",topPix = ".top",leftPix = ".left"
} else if (document.all) {
	isIE = true
}
function initTrail() { // prepares the script
	images = new Array() // prepare the image array
	for (i = 0; i < parseInt(trailLength); i++) {
		images[i] = new Image()
		images[i].src = path
	}
	storage = new Array() 
	for (i = 0; i < images.length*3; i++) {
		storage[i] = 0
	}
	for (i = 0; i < images.length; i++) { 		(isIE) ? document.write('<div id="obj' + i + '" style="position: absolute; z-Index: 100; height: 0; width: 0"><img src="' + images[i].src + '"></div>') : document.write('<layer name="obj' + i + '" width="0" height="0" z-index="100"><img src="' + images[i].src + '"></layer>')
	}
	trail()
}
function trail() { // trailing function
	for (i = 0; i < images.length; i++) { // for every div/layer
		eval("document." + range + "obj" + i + style + topPix + "=" + storage[d]) // the Y-coordinate
		eval("document." + range + "obj" + i + style + leftPix + "=" + storage[d+1]) // the X-coordinate
		d = d+2
	}
	for (i = storage.length; i >= 2; i--) { // save the coordinate for the div/layer that's behind
		storage[i] = storage[i-2]
	}
	d = 0 // reset for future use
	var timer = setTimeout("trail()",10) // call recursively 
}
function processEvent(e) { // catches and processes the mousemove event 
	if (isIE) { // for IE
		storage[0] = window.event.y+document.body.scrollTop+10
		storage[1] = window.event.x+document.body.scrollLeft+10
	} else { // for Navigator
		storage[0] = e.pageY+12
		storage[1] = e.pageX+12
	}
}
if (isNav) {
	document.captureEvents(Event.MOUSEMOVE) // Defines what events to capture for Navigator
}
if (isIE || isNav) { // initiates the script
	initTrail() 
	document.onmousemove = processEvent // start capturing
}
//-->
</script>
otro chistoso es http://www.jsmadeeasy.com/javascript...s/template.htm
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 15:15.