开发者

how to disable the screen on data load?

开发者 https://www.devze.com 2022-12-25 03:02 出处:网络
we are trying to show a loading image while the data is loading from the database. we are using AJAX calls for retrieving the data. Currently we are able 开发者_如何转开发to display that image. what w

we are trying to show a loading image while the data is loading from the database. we are using AJAX calls for retrieving the data. Currently we are able 开发者_如何转开发to display that image. what we need now is to disable the entire screen and show only the loading image while the data is loading.

is there any ready made solution to this??? i hope there are lot of frameworks which can do this. Please provide relevant pointers.

Thanks.


This can be done by creating a div(transparent) and overlayed above all the elements.

   var freezeDiv = document.createElement("div");
   freezeDiv.id = "freezeDiv";
   freezeDiv.style.cssText = "position:absolute; top:0; right:0; width:" + screen.width + "px; height:" + screen.height + "px; background-color: #000000; opacity:0.5; filter:alpha(opacity=50)";    
   document.getElementsByTagName("body")[0].appendChild(freezeDiv );
0

精彩评论

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

关注公众号