开发者

How do I disable a page after a submit?

开发者 https://www.devze.com 2023-02-11 03:21 出处:网络
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?

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="div开发者_Python百科Load" style="display:none;">
        <table id="tblLoading">...</table>
    </div>
</body>

$(document).ready(function () {
$(".reloadPage").click(function () {
    $("#divLoad").show();
    //grey backdrop and disable page
    ....
});
});


you can use jquery block ui plugin


or simplemodal: http://www.ericmmartin.com/projects/simplemodal/


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();


I used the filter:alpha(opacity = 0); opacity:0.0; style.

0

精彩评论

暂无评论...
验证码 换一张
取 消