Answers for "JavaScript loading page wait"

2

wait for page load js

window.addEventListener('load', function () {
  
})

//THE OTHER ANSWER IS WRONG (has a syntax error)
Posted by: Guest on November-07-2020
0

my loader is continously loading js

$('body').append('<div style="" id="loadingDiv"><div class="loader">Loading...</div></div>');
$(window).on('load', function(){
  setTimeout(removeLoader, 2000); //wait for page load PLUS two seconds.
});
function removeLoader(){
    $( "#loadingDiv" ).fadeOut(500, function() {
      // fadeOut complete. Remove the loading div
      $( "#loadingDiv" ).remove(); //makes page more lightweight 
  });  
}
Posted by: Guest on September-03-2020
0

display div while load

<script>
  $(window).load(function() {
    $('#loading').hide();
  });
</script>
Posted by: Guest on June-11-2020

Code answers related to "JavaScript loading page wait"

Code answers related to "Javascript"

Browse Popular Code Answers by Language