Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Overlay with spinner

Tags:

html

css

I'm trying to create an overlay that overlays a page with a spinner in the middle. What's the simplest way to accomplish this? I only need to worry about IE 8 and above.

like image 917
Webnet Avatar asked May 22 '11 22:05

Webnet


People also ask

How do you use react native loading spinner overlay?

Android: If set to false, it will prevent spinner from hiding when pressing the hardware back button. If set to true, it will allow spinner to hide if the hardware back button is pressed. Changes the spinner's color (example values are red , #ff0000 , etc). For adjusting the contrast see overlayColor prop below.


2 Answers

use a css3 class "spinner". It's more beautiful and you don't need .gif

enter image description here

.spinner {    position: absolute;    left: 50%;    top: 50%;    height:60px;    width:60px;    margin:0px auto;    -webkit-animation: rotation .6s infinite linear;    -moz-animation: rotation .6s infinite linear;    -o-animation: rotation .6s infinite linear;    animation: rotation .6s infinite linear;    border-left:6px solid rgba(0,174,239,.15);    border-right:6px solid rgba(0,174,239,.15);    border-bottom:6px solid rgba(0,174,239,.15);    border-top:6px solid rgba(0,174,239,.8);    border-radius:100%; }  @-webkit-keyframes rotation {    from {-webkit-transform: rotate(0deg);}    to {-webkit-transform: rotate(359deg);} } @-moz-keyframes rotation {    from {-moz-transform: rotate(0deg);}    to {-moz-transform: rotate(359deg);} } @-o-keyframes rotation {    from {-o-transform: rotate(0deg);}    to {-o-transform: rotate(359deg);} } @keyframes rotation {    from {transform: rotate(0deg);}    to {transform: rotate(359deg);} } 

Exemple of what is looks like : http://jsbin.com/roqakuxebo/1/edit

You can find a lot of css spinners like this here : http://cssload.net/en/spinners/

like image 185
Damien Romito Avatar answered Oct 11 '22 04:10

Damien Romito


#overlay {     position: fixed;     width: 100%;     height: 100%;     background: black url(spinner.gif) center center no-repeat;     opacity: .5; } 

it's better to use rgba color instead of opacity to prevent applying alpha to spinner image.

background: rgba(0,0,0,.5) url(spinner.gif) center center no-repeat; 
like image 44
seler Avatar answered Oct 11 '22 05:10

seler