1
Follows code:
HTML:
<!-- Button trigger modal -->
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
  Launch demo modal
</button>
<div id="myModal" class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h4 class="modal-title">Modal title</h4>
      </div>
      <div class="modal-body" style="height: 300px">
        <div class="loader" style="position: absolute; top: 0; bottom: 0; left: 0; right: 0; margin: auto;"></div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save changes</button>
      </div>
    </div>
    <!-- /.modal-content -->
  </div>
  <!-- /.modal-dialog -->
</div>
<!-- /.modal -->
CSS:
.modal-body {
  max-height: calc(100vh - 210px);
  overflow-y: auto;
}
.loader {
  border: 16px solid #f3f3f3;
  /* Light grey */
  border-top: 16px solid #3498db;
  /* Blue */
  border-radius: 50%;
  width: 120px;
  height: 120px;
  animation: spin 2s linear infinite;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
If you prefer Jsfiddle: https://jsfiddle.net/ZcLSE/1801/
Problem:
It is showing the scroll bar alone while loading makes animation. How can I fix this ?
it is necessary to
scrollbar?– NoobSaibot
Yes, after loading, it will load the contents ...
– Matheus Miranda
And where is the function of
loading? Put here on the question, do not need to use external websites, just paste the code select it and pressCTRL+Kto format.– NoobSaibot
I don’t call the function
loading, itself is in html. After returning the ajax function, I do it myselfhideto hide animationloading. It seems that the problem is in css.– Matheus Miranda
@Souza Post edited, see !
– Matheus Miranda