Efeito de Onda em Textos


 

01
Criado Por Fabio Roberto Poletto **soartes**
02
03<style>
04#theDiv {
05 POSITION : relative;  Z-INDEX : 8; VISIBILITY : visible; ALIGN : center;
06 }
07</style>
08
09
10<script language="JavaScript">
11//script found on a1javascripts.com
12//full credit to the unknown autor
13function nextSize(i,incMethod,textLength)
14{
15if (incMethod == 1) { return (22*Math.abs(Math.sin(i/(textLength/3.14))) );
16}
17if (incMethod == 2) { return (255*Math.abs(Math.cos(i/(textLength/3.14))));
18}
19return(0)
20}
21function sizeCycle(text,method,dis)
22{
23var output = "";
24for (i = 0; i < text.length; i++) {
25size = parseInt(nextSize(i +dis,method,text.length));
26output += "<font style='font-size: "+ size +"pt'>" +text.substring(i,i+1)+ "</font>";
27}
28if (document.all)
29theDiv.innerHTML = output;
30else if (document.getElementById){
31rng = document.createRange();
32el = document.getElementById('theDiv');
33rng.setStartBefore(el);
34htmlFrag = rng.createContextualFragment(output);
35while (el.hasChildNodes()) el.removeChild(el.lastChild);
36el.appendChild(htmlFrag);}
37else if (document.layers){
38
39document.theDiv.document.write("<font face='Arial'point-size=11>"+output+"</font>");
40document.theDiv.document.close();}
41
42
43}
44//place your text here
45
46function doWave(n) {
47var theText = 'Fabio Poletto**soartes**';
48
49sizeCycle(theText,1,n);
50if (n > theText.length) {
51n=0
52}
53setTimeout("doWave(" + (n+1) + ")", 50);
54}
55
56</script>
57
58
59<body onload="doWave(0)">
60
61
62<div ID="theDiv" align="center"></div> VEJA O CODIGO EM AÇÃO


Comentários

Anterior Proxima Página inicial