Texte loop et bondissant

Description

faire des bond des loop avec du texte....

mon deuxieme script ;

Source / Exemple :


<html>
<head>

<!-- debut (dans head) //-->

 <SCRIPT language="JavaScript">
<!--
function fantome_anim() {
	return
}
function fantomehaut() {
	this.start	= fantome_anim
}
function fantomeloop() {
	this.start	= fantome_anim
}

function fantomehautdebut() {
	if(this.running)
		return
	this.running	= true
	this.counter	= 0
	if(document[this.id]) {
		this.pos	= parseInt(document[this.id].top)
		setTimeout(this.name + ".end()", this.duration_effect)
	}
	else {
		this.pos	= parseInt(window[this.id].style.posTop)
		setTimeout(this.name + ".end()", this.duration_effect)
	}
}

function fantomehautfin(akt_pos) {
	var welle = this.hoehe * Math.sin(Math.PI * this.increment * this.counter)

  • ((this.max_counter - this.counter) / this.max_counter)
if(document[this.id]) document[this.id].top = this.pos + welle else window[this.id].style.posTop = this.pos + welle this.counter++ if(this.counter == this.max_counter) { if(document[this.id]) document[this.id].top = this.pos else window[this.id].style.posTop = this.pos setTimeout(this.name + ".running = false", this.duration_wait) } else setTimeout(this.name + ".end()", this.duration_effect) } function fantomehaut(id, name) { this.hoehe = 10 this.duration_effect = 5 this.duration_wait = 1000 this.running = false this.id = id this.name = name this.increment = .1 this.pos = 0 this.counter = 0 this.max_counter = 100 this.start = fantomehautdebut this.end = fantomehautfin } function fantomeloopdebut() { if(this.running) return this.running = true this.counter = 0 if(document[this.id]) { this.pos_x = parseInt(document[this.id].left) this.pos_y = parseInt(document[this.id].top) setTimeout(this.name + ".end()", this.duration_effect) } else { this.pos_x = parseInt(window[this.id].style.posLeft) this.pos_y = parseInt(window[this.id].style.posTop) setTimeout(this.name + ".end()", this.duration_effect) } } function fantomeloopfin(akt_pos) { var r_x = this.radius * Math.sin(Math.PI * this.increment * this.counter) * Math.sin(Math.PI * this.counter / this.max_counter) var r_y = this.radius * Math.cos(Math.PI * this.increment * this.counter) * Math.sin(Math.PI * this.counter / this.max_counter) if(document[this.id]) { document[this.id].left = this.pos_x + r_x document[this.id].top = this.pos_y + r_y } else { window[this.id].style.posLeft = this.pos_x + r_x window[this.id].style.posTop = this.pos_y + r_y } this.counter++ if(this.counter == this.max_counter) { if(document[this.id]) { document[this.id].left = this.pos_x document[this.id].top = this.pos_y } else { window[this.id].style.posLeft = this.pos_x window[this.id].style.posTop = this.pos_y } setTimeout(this.name + ".running = false", this.duration_wait) } else setTimeout(this.name + ".end()", this.duration_effect) } function fantomeloop(id, name) { this.radius = 24 this.duration_effect = 5 this.duration_wait = 1000 this.running = false this.id = id this.name = name this.increment = .05 this.pos_x = 0 this.pos_y = 0 this.counter = 0 this.max_counter = 150 this.start = fantomeloopdebut this.end = fantomeloopfin } var fantome1 = new fantomehaut("T1", "fantome1") var fantome2 = new fantomeloop("T2", "fantome2") var fantome3 = new fantomeloop("T3", "fantome3") var fantome4 = new fantomehaut("T4", "fantome4") var fantome5 = new fantomehaut("T5", "fantome5") //--> </SCRIPT> </head> <body> <br><a style="position: relative" id="T1" onmouseover="fantome1.start()">lien</a> <br><a style="position: relative" id="T2" onmouseover="fantome2.start()">lien</a> <br><a style="position: relative" id="T3" onmouseover="fantome3.start()">lien</a> <br><a style="position: relative" id="T4" onmouseover="fantome4.start()">lien</a> <br><a style="position: relative" id="T5" onmouseover="fantome5.start()">lien</a> </body> </html>

Conclusion :


dans le zip

Codes Sources

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.