I have made 3 css classes which look like this:
.modal {
display: none;
position: fixed;
z-index: 1000;
top: 0;
left: 0;
height: 100%;
width: 100%;
background: rgba( 255, 255, 255, .8 ) url('') 50% 50% no-repeat;
background-image: url('../../images/gears.svg');
}
body.loading {
overflow: hidden;
}
body.loading .modal {
display: block;
}
Upon jQuery event onclick I display to the end user so the user knows something's happening.
What I don't like here is that the loading appears very forcingly , there is no smoothness in transition when it appears and when it disappears. What I do to show the loading gears to user is:
$body = $("body");
And then to display it:
$body.addClass("loading");
Or to remove it:
$body.removeClass("loading");
How can I add smooth transition of when the loading gears appear and disappear using jquery or CSS so that the animation looks more friendly?
Can someone help me out ?