Looking for a solution regarding a 'bouncing loader' div that moves up and down in an infinite loop? Check out this jsfiddle
However, the issue arises when I place a button below the loader, as it also moves in sync with the animation effect.
Is there a way to prevent the button from moving along with the loader?
I have attempted to add margins
and padding
to both elements, but these solutions proved ineffective and were subsequently removed.
The HTML structure for the loader is as follows:
<div class="loader" style="float:initial;">
<span></span>
<span></span>
<span></span>
</div>
<br />
<div>
<button id="popupArea">Click here to invoke a popup window</button>
</div>
The corresponding CSS rules are:
.loader {
text-align: center;
}
.loader span {
display: inline-block;
vertical-align: middle;
width: 10px;
height: 10px;
margin: 50px auto;
background: black;
border-radius: 50px;
-webkit-animation: loader 0.9s infinite alternate;
-moz-animation: loader 0.9s infinite alternate;
}
.loader span:nth-of-type(2) {
-webkit-animation-delay: 0.3s;
-moz-animation-delay: 0.3s;
}
.loader span:nth-of-type(3) {
-webkit-animation-delay: 0.6s;
-moz-animation-delay: 0.6s;
}
@-webkit-keyframes loader {
0% {
width: 10px;
height: 10px;
opacity: 0.9;
-webkit-transform: translateY(0);
}
100% {
width: 24px;
height: 24px;
opacity: 0.1;
-webkit-transform: translateY(-21px);
}
}
@-moz-keyframes loader {
0% {
width: 10px;
height: 10px;
opacity: 0.9;
-moz-transform: translateY(0);
}
100% {
width: 24px;
height: 24px;
opacity: 0.1;
-moz-transform: translateY(-21px);
}
}
Any guidance or suggestions on resolving this issue would be greatly appreciated.
Please be aware that I do not have knowledge of jquery, therefore I would prefer to minimize its usage (hence my reliance on asp MVC).