I have seen this done many times but when I go look this up there does not seem to be an easy way or at least a website that tells me what it is doing and why.
Ideally what I want to do is create a container (div
) that has both a loading and the actually form inside of it.
<div id="mycontainer" class="container">
<div class="loading">//Image of a loading gif or message
<div>
<div class="myactualform">
<input id="firstname" />
<input id="btnSend" type="button" />
</div>
</div>
My question comes to be is how do I make "myactualform" hide and "loading" show? So that loading class takes up the same space as the "myactualform" took. Imagine it has something to do with changing z-index
s. I am pretty sure this is CSS issue.
Note:
I have used the $(".classname1").hide()/$(".classname2").show()
from jQuery but the issue I have is the div shrinks.
I created a jsfiddle project at: http://jsfiddle.net/aHW33/ (the HTML code in there is different then here to show an expanded version)