Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

265
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda