Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I need examples for adding a throbber during page loads

Does someone have a code example of running an animated throbber during asp.net page loads? More than one example would be appreciated.

like image 766
crackedcornjimmy Avatar asked Mar 25 '11 15:03

crackedcornjimmy


People also ask

How do I display a loading screen while site content loads?

visible through css [ display:block; ] and make the rest of the page invisible through css[ display:none; ]. Once the loading is done, just make the loading invisible and the page visible again with the same technique. You can use the document. getElementById() to select the divs you want to change the display.

How do I show page loading Div until the page has finished?

Step 1: Add a background with a spinner gif on top of the page, then remove them when everything is loaded. Step 2: Add a little script right after the opening body tag to start displaying the load/splash screen. Highly active question.


3 Answers

A throbber is generally just an animated .gif that holds the place of content. When the content is loaded, that image is hidden or removed from the dynamic element and replaced with the actual content (or vice versa if you're making a form or similar).

Here's a link to the Facebook "throbber" - http://static.ak.fbcdn.net/rsrc.php/v1/zb/r/GsNJNwuI-UM.gif

Here's a link to a Wikipedia asset: https://upload.wikimedia.org/wikipedia/commons/d/de/Ajax-loader.gif

Matching article: https://en.wikipedia.org/wiki/Throbber

As you can see, it's an animated gif.

Update: If you're still using this for reference then please check out the CSS throbbers in various projects.

like image 155
tamarintech Avatar answered Nov 02 '22 23:11

tamarintech


On http://ajaxload.info/ you can generate your own :)

like image 39
wildcard Avatar answered Nov 03 '22 01:11

wildcard


You can use asp.net AJAX UpdateProgress control. Put your throbber image in the ProgressTemplate.

The issue with that is you will have to use UpdatePanel for that. If you are already using it nice.

Another options you might want to look into:

Use jQuery to show/hide your throbber.

jQuery UI's progressbar plugin.

like image 40
gbs Avatar answered Nov 03 '22 01:11

gbs