Jump to content

Recommended Posts

PHP 2.11.10

 

I have a php page that loads. It takes about 4-5 seconds because I am constructing a select/combo box with 2400 records. While the whole page is loading I would like to make the cursor an hourglass while the cursor is over the PHP page, so the user cannot click on anything until the page is done loading.

 

During production I expect 10,000 records in this combo box so disabling user input while the page is loading becomes more important.

 

How do I do that?

 

You'd need to do it in JavaScript - I'd recommend loading in the contents with AJAX.

 

If you were using the jquery library you could do something like

 

//set cursor as wait with css

$('body').css('cursor', 'wait');

 

//load results into div

$('#info').load('results.php', function(){

//load has completed

$('body').css('cursor', 'auto');

});

 

More info: http://api.jquery.com/load/ + http://api.jquery.com/css/

  • 2 weeks later...

This is pretty Simple:

 

change your css file to ...

 

body{

cursor: wait;

}

 

and then use this fucntion in head

<script type="text/javascript">

window.onload=function(){
document.body.style.cursor='auto';
}


</script>

Hope this answers the question.

  • 3 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.