views:

20

answers:

1

hi, 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.

+1  A: 

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

Cheers

Ramesh Vel
Thanks for the reply Ramesh. that code really helped me to disable the below screen. Now i want to display an DIV on top of the everything, saying Loading is in progress and an image which hints at loading. Any thoughts how we can do this?i tried, but the image is getting displayed below the trasparent thing.Thanks
mj
Ramesh Vel