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

185
Visualizações
How to activate the countdown after the page loads up?

There is some odometer items in template that I want to use for the my Website ( My programming language is : Asp.net Core ) :

1

The countdown effect occurs when it is visible to the user ( like when page scroll to that )

my Problem is that : this section is in the main banner of the site (below the header) and the countdown effect ends before the page loads. Because the page is in the countdown desired position before load

And When the page is loaded, only the final result of the countdown is displayed! (simple text without effect) :

2

This is my code :

    <div class="funfacts-area">
    <div class="row">
        @foreach (var item in LandingItems)
        {
        <div class="col-lg-3 col-md-3 col-6 col-sm-3">
            <div class="funfact">
                <h3><span class="odometer" data-count="@item.count" dir="ltr">00</span>+</h3>
                <p>@item.name</p>
            </div>
        </div>
        }
    </div>
</div>

This code only works when : Use Ctrl + F5 ( clear cache ) in the middle of the page and scroll to the top banner : The countdown effect is then activated and start counting...

I tried to send this code as a PartialViewResult to View after full load { jquery: windows.onload () }. But Unfortunately, countdown cannot detect the user position for countdown activation and the values are 00

3

What is the solution to this problem? Please Help me...

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

0

You could try using EventListener. Executes after DOM is loaded (before img and css):

document.addEventListener("DOMContentLoaded", function(){
    //....
});

Or

Exectues after everything is loaded and parsed:

window.addEventListener("load", function(){
    // ....
})

about 4 years ago · Juan Pablo Isaza Relatório

0

Re-value the Html content to reactivate the odometer countdown :

        $(window).on('load', function () {
        $('.odometer').each(function () {
            $(this).html("-");
            $(this).html($(this).data("count"));
        });
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