I want to add a sleek animation while loading content using ajax. My goal is to display an icon while the "Content" div is reloading, but I'm not sure if this can be achieved with just CSS.
The icon needs to:
- Always be horizontally centered within the "Content" div
- Be vertically centered within the visible part of the content
- Remain vertically centered within the visible part of the content throughout a sliding animation that hides the Menu
If vertical centering based on the visible part of the content isn't possible, I'm fine with centering the image according to the browser's viewport.
[EDIT]:
Check out my fiddle here: http://jsfiddle.net/QWB9x/74/. The section that probably needs adjusting is:
.loading #img_loading {
position: fixed;
top: 50%;
left: 50%;
display: block;
}