Jump to content

Make cursor an hourglass while php page loads


bulrush

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?

 

Link to comment
Share on other sites

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/

Link to comment
Share on other sites

  • 2 weeks later...
  • 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.