Reputation: 22009
I am looking for a way to prevent multiple submits on a page. I have a table that is displayed on a submit or href click in jquery. How do I have everything behind the table grey opacity and disabled?
<head>...</head>
<body>
<input class="reloadPage" type="button"/>
...
<div id="divLoad" style="display:none;">
<table id="tblLoading">...</table>
</div>
</body>
$(document).ready(function () {
$(".reloadPage").click(function () {
$("#divLoad").show();
//grey backdrop and disable page
....
});
});
Upvotes: 1
Views: 2326
Reputation: 3580
To do it manually you could try the following.
Add this style
#block
{
background-color:#000;
opacity:0.5;
position:absolute;
width:100%;
height:100%;
top:0px;
}
Then this code should black out the screen.
$("body").append("<div id='block'></div>");
To remove it call:
$("#block").remove();
Upvotes: 1