开发者

How do I disable a page after a submit?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜