When the sign-up button is clicked, a modal pops up. After inputting data, upon hitting the "sign up" button, I would like the actual popup's HTML content to become inactive and display a loading GIF icon in the center until an AJAX response is received.
For example, the code for the modal structure:
<div class="modal" id="mymodal">
<div id="modalcontent">
<div id="modalhead"> </div>
<div id="modalbody"> </div>
<div id="modalfooter"> </div>
</div>
</div>
JavaScript code snippet:
$('#modalcontent').html('<img src=\'/static/img/modalloader.gif\'/>');
However, this code does not make the background HTML elements inactive. Instead, it removes all the content, causing the large modal to shrink to the size of the loading GIF icon.
How can this issue be resolved?