Efeito Maquina de Escrever by $r0xx.sh 23.04.13 0:29
Sabe aquele efeito no qual uma letra é adicionada por vez na tela, como se alguém tivesse digitando???
Com essas 2 funções que eu fiz isso é possivel em JS.
Aproveitem xD...
Att,$r0xx.sh - Programmer and Professional Hacking
Com essas 2 funções que eu fiz isso é possivel em JS.
- Código:
//© Code by $r0xx.sh - No copy! (23/04/2013)
function carregando(){
conteudo = document.getElementById("msg");
var caracteres = new Array;
caracteres[0] = " / ";
caracteres[1] = " - ";
caracteres[2] = " \\ ";
var num = 0;
intervaloCarregando = setInterval(function(){
conteudo.innerHTML = "Carregando..." + caracteres[num];
num++;
if (num == 3) {
num = 0;
}
}, 100, "intervalo")
}
function tipewritter(){
var msg = prompt("Digite aqui sua mensagem:", "Efeito Maquina de Escrever em Javascript by $r0xx.sh");
var tamanhoMsg = msg.length;
var conteudo = document.getElementById("msg");
var i = 0;
var carUnderline = "_";
carregando();
setTimeout(function(){
clearInterval(intervaloCarregando);
intervaloTypeW = setInterval(function(){
conteudo.innerHTML = msg.substr(0, i) + carUnderline;
i++;
if (i - 1 == tamanhoMsg) {
carUnderline = "";
clearInterval(intervaloTipeW);
}
}, 100);
}, 2000);
}
window.onload = tipewritter;
Aproveitem xD...
Att,$r0xx.sh - Programmer and Professional Hacking