I am trying create nice animation during loading content using ajax. I want to use display icon during reloading div with "Content", however I can't figured out is it possible to do that only with CSS.

Icon should:

  1. horizontally always in the center of div with "Content"
  2. vertically always in the center of "visible part of content"
  3. should stay during whole animation in the vertically center of "visible part of content" during slide animation which hides Menu.

enter image description here enter image description here enter image description here

If vertical centering according to "visible part of content" is not possible, it would be ok to center image according to viewport of the browser.

[EDIT]:

Here is my fiddle: http://jsfiddle.net/QWB9x/74/ and the part which probably should be changed:

.loading #img_loading {
    position: fixed;
    top: 50%;
    left: 50%;
    display: block;
}
Edit
Report