lundi 19 mars 2018

How to hide a DIV when reloading a page?

I have a loading overlay that shows some information and I have a button to refresh the page. But I want the loading overlay only to appear once, not every time the button is clicked. (F5 doesn't matter). I was thinking of something like this:

<button type="button" onclick="reload();">

function reload() {
  if (window.location.reload()) {
     document.getElementById('loading').style.display = 'none';
  }
}

But it doesn't work... pls help

Aucun commentaire:

Enregistrer un commentaire