Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Overlay progress bar with jQuery

I want to display a progress bar that "overlays" the page, disabling other actions while it's running, kind of like an alert (except you couldn't exit it by clicking anything). What's a fast way to do this in jQuery?

I already have the image picked out-- an animated progress bar. Just need a way to properly overlay it.

like image 634
bgcode Avatar asked Jun 05 '11 01:06

bgcode


3 Answers

You can easily implement your own overlay.

#overlay {
  background-color: black;
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  opacity: 0.2; /* also -moz-opacity, etc. */
  z-index: 10;
}

Then display <div id="overlay"><img src="/path/to/your/image"/></div> when your page is loading, or whenever you want to display it.

like image 54
Bertrand Marron Avatar answered Nov 14 '22 01:11

Bertrand Marron


I think the jQuery UI Modal is what you're looking for. It overlays the rest of the screen, until a user dismisses the dialog. You can add your progress bar inside the dialog itself or add the jQuery UI progress bar as well, if you find out that works better. That also has a lot of options that you may find handy.

If you want this to be truly a "can't-do-anything-until-this-finishes" type of dialog, then you can also take out the closing "X" using this solution.

like image 29
eksith Avatar answered Nov 14 '22 02:11

eksith


Have you taken a look at qTip? This is what we use it for.

like image 1
Christopher Armstrong Avatar answered Nov 14 '22 01:11

Christopher Armstrong