Fausse bannière de pub

Contenu du snippet

Chaque ligne du tableau apparait en grandissant et disparait graduellement.

Source / Exemple :


<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY onload="InitColors(30)">

<DIV ID="Banner" STYLE="border: 1 solid black; width: 468; font: 8 Arial Black; text-align: center; height: 50; background: #FF9900; color: #003366; font-weight: bold; cursor: default"></DIV>

<SCRIPT>
var Texts = new Array()
Texts[0] = "Des vidéos"
Texts[1] = "que des vidéos"
Texts[2] = "rien que des vidéos ! ! !"
Texts[3] = "Http://www.videofolies.net"
var Colors = new Array()
var iSize = 0
var iColor = 0
var iText = 0
function ShowText(){
	var tmp = 0
	Banner.innerHTML = Texts[iText]
	Banner.style.color = "#" + Colors[0]
	iText == Texts.length-1 ? iText=0 : iText++
	ChangeSize(1,30)
}
function ChangeSize(size, max){
	if (size >= max){iColor = window.setTimeout("ChangeColor(0)",700); return(true)}
	Banner.style.fontSize = "" + size + "px"
	iSize = window.setTimeout("ChangeSize("+(size+2)+","+max+")",30)
}
function ChangeColor(i){
	if (i == Colors.length-1)
		{
			window.clearTimeout(iColor)
			setTimeout("ShowText()",200)
		}
		else
		{
			Banner.style.color = Colors[i]
			iColor = window.setTimeout("ChangeColor("+(i+1)+")",10)
		}
}
function InitColors(Steps){
	var Start = Banner.style.color
	var End = Banner.style.backgroundColor
	Start = Start.substring(1,7)
	End = End.substring(1,7)
	var StartRed = parseInt(Start.substring(0, 2),16)
	var StartGreen = parseInt(Start.substring(2, 4),16)
	var StartBlue = parseInt(Start.substring(4, 6),16)
	var EndRed = parseInt(End.substring(0, 2),16)
	var EndGreen = parseInt(End.substring(2, 4),16)
	var EndBlue = parseInt(End.substring(4, 6),16)
	GradientPart(StartRed, StartGreen, StartBlue, EndRed, EndGreen, EndBlue, Steps)
	ShowText()
}
//	convertion decimal ver hexa
function Hexa(Dec){
	var nb = Dec.toString(16)
	if (nb.length < 2) {nb = "0" + nb}
	return(nb)
}
function GradientPart(dr, dg, db, fr, fg, fb, Step) {			
	cr=dr; cg=dg; cb=db
	sr=((fr-dr)/Step)	// rouge
	sg=((fg-dg)/Step)	// vert
	sb=((fb-db)/Step)	// bleu
    for (var x = 0; x <= Step; x++) {
		Colors[x] = Hexa(Math.floor(cr)) + Hexa(Math.floor(cg)) + Hexa(Math.floor(cb))
		cr += sr; cg += sg; cb += sb
		}
}
</SCRIPT>

</BODY>
</HTML>

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.