Jquery put a popup until the whole page is loaded and doesn't allows to click outside any help encouraged. Thanks in advance
Asked
Active
Viewed 972 times
1
-
show some code would be very nice of you. – KJYe.Name Mar 01 '11 at 14:49
-
is that a request or a problem? – Pherrymason Mar 01 '11 at 14:51
-
Request. And I don't think anycode will help. Its just like u imaginr a simple jquery code and doesnt allows to see it until the pages loads – kritya Mar 01 '11 at 15:51
2 Answers
3
You can do this without jQuery, also you can write some code using jQuery to just make sure that the page is ready.
You can add a big div in the first lines of your page html:
<head></head>
<html>
<body>
<div class="bigFullScreen"></div>
.......... the rest of the page html
</body>
</html>
And in javascript:
$(function () {
$('.bigFullScreen').hide();
});
OR:
$(document).ready(function () {
$('.bigFullScreen').hide();
});
The previous html and jQuery will make sure that the big div will appear the first thing and just when all the html of the page is rendered the jQuery function will hide it.
UPDATE: You can also wait untill all the html including all the images get ready: http://amrelgarhy.com/blog/how-to-tell-when-images-have-loaded/

Amr Elgarhy
- 66,568
- 69
- 184
- 301
-
Thanks but not quite exactly what I wanted but this will be helpful at many other places. I worked it out myself. But still thanks for help :D – kritya Mar 02 '11 at 05:31
-
Well its like u create centred div with high zindex and don't allow user to close it. And then just use the hide function to hide it. Won't be able to give complete code atm cus using mobile.will give 10 to 13 hours later :D – kritya Mar 02 '11 at 17:47
0
You could look at using a JQuery UI dialog and setting modal
to true.
How to remove close button on the jQuery UI dialog? has information on "locking down" the dialog. You'll need to set CloseOnEscape
to false too.

Community
- 1
- 1

StuperUser
- 10,555
- 13
- 78
- 137
-
Thats not a problem my freind. But I want that it should like not allow user to close it or click out until it closses automatically – kritya Mar 01 '11 at 15:48
-
Have a look at: http://stackoverflow.com/questions/896777/remove-close-button-on-jqueryui-dialog for how to do that, you'll need to set the close on escape option to false too. – StuperUser Mar 01 '11 at 15:54