Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

245
Visualizações
Creating a matrix-like effect where number and letters repeat on webpage?

My goal is as follows: create an html header that constantly iterates through a random array full numbers and letters that makes a "matrix" like effect where the initial word on the html doc looks like some cryptographic loop.

const alphabet = [
  "a",
  "b",
  "c",
  "d",
  "e",
  "f",
  "g",
  "h",
  "i",
  "j",
  "k",
  "l",
  "m",
  "n",
  "o",
  "p",
  "q",
  "r",
  "s",
  "t",
  "u",
  "v",
  "w",
  "x",
  "y",
  "z",
  1,
  2,
  3,
  4,
  5,
  6,
  7,
  8,
  9,
];

let randomIndex = Math.floor(Math.random() * alphabet.length);

hash.addEventListener("mouseover", function (randomIndex) {
  for (i = 0; i < Infinity; i++) {
    let randomItem = alphabet[randomIndex];
  }
  hash.innerHTML = `${randomItem}`;
});

My question is a) how do i replace the newly generated randomItem with the next value that generates and b) is there a way to make it so my pc doesn't crash? lol

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

requestAnimationFrame is the answer. Turns out the loop was going so fast I couldn't see the changes.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda