How can I position my loading indicator in the center of the screen. Currently I'm using a little placeholder and it seems to work fine. However, when I scroll down, the loading indicator stays right in that predefined position. How can I make it follow the scrolling so that it always sits on top??
#busy
{
position: absolute;
left: 50%;
top: 35%;
display: none;
background: transparent url("../images/loading-big.gif");
z-index: 1000;
height: 31px;
width: 31px;
}
#busy-holder
{
background: transparent;
width: 100%;
height: 100%;
}
change the position absolute of div busy to fixed
This is what I've done for Angular 4:
Worked for me in angular 4
by adding
style="margin:0 auto;"
You can use this OnLoad or during fetch infos from DB
In HTML Add following code:
In CSS add following Code:
if you want to show and hide from JS:
use
position:fixed
instead ofposition:absolute
The first one is relative to your screen window. (not affected by scrolling)
The second one is relative to the page. (affected by scrolling)
Note : IE6 doesn't support position:fixed.