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

264
Visualizações
Bulma: make links bold, wait 1000 ms, then make them un-bold

Using vanilla javascript and bulma.css, how can I unhide a span, make all the links in the span bold, then after a given amount of time (say, 1000 ms), take away the bold font weight. The first part, unhiding and making the links bold works fine using the following code:

function unhide_bold_unbold() {
    mode_sents = document.getElementsByClassName('kanji-sent')
    for (let i = 0; i < mode_sents.length; i++) {
        mode_sents[i].classList.remove('is-hidden')
        // Bold all links
        links = mode_sents[i].getElementsByTagName('a')
        for (let j = 0; j < links.length; j++) {
            links[j].classList.add('has-text-weight-bold')
        }
    }
}

I tried adding the following at the end of the function, but it just delays the unhiding by 1000 ms, and the links never look bold.

    sleep(wait_ms)
    for (let i = 0; i < mode_sents.length; i++) {
        links = mode_sents[i].getElementsByTagName('a')
        for (let j = 0; j < links.length; j++) {
            links[j].classList.remove('has-text-weight-bold')
        }
    }

...which uses the following function:



function sleep(milliseconds) {
  const date = Date.now();
  let currentDate = null;
  do {
    currentDate = Date.now();
  } while (currentDate - date < milliseconds);
}

How can I make bulma's class update the font weight, then wait, then remove the bold font weight?

<span class="kanji-sent is-hidden"><a onclick="show_kanji_data('彼')">彼</a>等は皆、この<a onclick="show_kanji_data('曇')">曇</a>天に押しすくめられたかと思う程、揃って背が低かった。</span>
about 4 years ago · Juan Pablo Isaza
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