could any body explain what I should modify, how after hiding the image, still keep the div as a blank with no content but the same width and height as it were with image,
Exact example: http://jsfiddle.net/rJuWL/1/
So after hiding, Second! comes to First!,
but I need to keep it as
First!
blank
Second!
Html
<html>
<body>
<div>First!</div>
<div class="loading">
<img id="loading" src="http://preloaders.net/preloaders/284/preview.gif" class="none"/>
<div>Second!</div>
</div>
</body>
Css
.none{display:none}
.loading{width: 32px;height:32px;}
Javascript
showLoading();
function showLoading() {
$("#loading").hide();
$("#loading").show().delay(2500).fadeOut('10');
}
Dont hide it with
display:none, setvisibility:hiddendisplay:nonewill take it out of the DOM flow. Changing thevisibilitytohiddenwill keep it there but emulate settingopacityto 0.Here’s a quick demo which keeps your
fadeOuthttp://jsfiddle.net/AlienWebguy/5cwE7/