Edit on
<body>
  Conteúdo normal da página
  <button onclick="document.body.className = 'loading'; return false;">Load na página</button>
  <div id=mydiv>
    div com conteúdo
    <button onclick="document.getElementById('mydiv').className = 'loading'; return false;">Load só no div</button>
  </div>
</body>
#mydiv{
  min-height:4em;
  border:solid 1px;
  padding:.5em;
  margin:.5em 0;
}

@-moz-keyframes loading-anim {
  0%,
  60% {
    opacity: 0;
  }
  100% {
    opacity: 0.4;
  }
}
@-webkit-keyframes loading-anim {
  0%,
  60% {
    opacity: 0;
  }
  100% {
    opacity: 0.4;
  }
}
@keyframes loading-anim {
  0%,
  60% {
    opacity: 0;
  }
  100% {
    opacity: 0.4;
  }
}

.loading{
  cursor:wait;
  pointer-events:none;
}

body .loading{
  position:relative;
}

body.loading:after{
  position:fixed;
  max-width:100vw;
  max-height:100vh;
}

.loading:after {
    opacity: 0.6;
  -moz-animation: loading-anim 2s ease-in-out;
  -o-animation: loading-anim 2s ease-in-out;
  -webkit-animation: loading-anim 2s ease-in-out;
  animation: loading-anim 2s ease-in-out;
    pointer-events:auto;
    content: "";
    cursor: wait;
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.7) url("data:image/gif;base64,R0lGODlhoAAUAMIAAFxeXMzKzPz+/KyqrNTS1GRiZMzOzE1NTSH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCAAHACwAAAAAoAAUAAAD/ni63P4wykmrvTjrzbv/YCiOZGmeaKqubOu+cCzPGzAEwQBINq7zt9wu0hMCfUNI8UcMMpXO5GMpdVAjBYNgKzAUIFlu9/sIc71g7ZnsMG/RZfWb3XCP02J4W36P5+kMA2JbAxCCg4UPh2KJDotcjQ2PhIaDApGBlpgLk5eViJ+MEASWBBB8W6YPqAKqDqyuDbCnpbSDsQyzq7W7t7ZiuAukvg/DwKO8DsZcwQrLqcjEyskNz63Rx4qaoZDclNqg4KLi3eTfjtvmnuqbCgXLBIALdvF4zPLufPV+9/ap+AfoARTor9VAfQAP2DBg4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