Implement Loader while loading the page

Asked

Viewed 211 times

1

I would like to better understand a resource widely used in web systems where you access a page it displays a 'Download' while the content is not ready.

How to implement this in a PHP system that does some delivery procedures to the front end that also handles some DOM’s?

  • Buddy, I usually use this when I upload a page in AJAX.

1 answer

0

Boot a <div> with

position: absolute;
top: 0px;
left: 0px;
z-index: 100;

Inside it you put your image Oader, just do the style to center it.

Then just make the logic so it appears or hide.

Ex:

<div id="meuLoader">...</div>

<script>
    // rolou algum processamento no seu .php ou vc fez um ajax
    $('#meuLoader').addClass('hidden'); // classe do bootstrap que coloca estilo 'display: none';
</script>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.