开发者

jQuery - Disable HTML Page until .load calls is done

What is the easiest way to disable an entire HTML page until an initial .load call is complete? What I mean by disable is the user can not interact with it in any way. It is ok for them to navigate away.

I am using jQuery 1.2.6. Is it to set the call to be syn开发者_JAVA技巧c instead of async? how do you set options for this on the .load function?

UPDATE

this seems to be working - am I off base?

function doSomething() {
     $.ajaxSetup({ async: false });
     $('#someArea').load('... args ...');
     $.ajaxSetup({ async: true });
}


Block with HTML+CSS, unblock with jQuery

The best way would be to have your HTML with the overlaid DIV that blocks all clicks to the content of the page. So it acts as a mask. This mask would have to be positioned, dimensioned and styled using CSS.

When page load happens, you can use jQuery and remove this mask hence enable your page.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜