亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Number counter animation preloader window when loading Javascript Html CSS
P粉523625080
P粉523625080 2023-09-11 22:37:54
0
1
894

I want to create a number counter animation on my portfolio website. I have some jquery code in my old website that transitions from the preloader to the website when fully loaded.

<script>
  $(window).on('load', () => {
    $('#preloader').fadeOut(1800, function() {
      $(this).remove();
    });
  });
    </script>

How to add number counter animation and add side to upward transition? Thanks

P粉523625080
P粉523625080

reply all(1)
P粉497463473

for you.

  1. Announce count.
  2. Decrease the count value.
  3. Delete the counter span based on the counter value slideUp of your div and .

Example:

$(window).on('load', () => {
  let count = 3;
  function ShowCounter() {
    if (count > 0) {
      $("#spnNumber").fadeOut('slow', function() {
        $("#spnNumber").text(count);
        $("#spnNumber").fadeIn();
        count--;
      });

    } else if (count == 0) {
      $("#preloader").slideUp();
      $("#spnNumber").remove();
      clearInterval(interval);

    }

  }
  var interval = setInterval(function() {
    ShowCounter()
  }, 1000)
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id='preloader'>Loading ... </div>
<span id='spnNumber'><span>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template