I want to fade in and out continuously a text in the div's content and also I want to alternate between two phrases (or if it is not possible alternate between two phrases, at least fade in and out the same phrase continuously). Below my code not working (Dynamically):
'<div><div class="image-blockUI" /><div class="text-blockUI-container"><div class="text-blockUI">Loading...</div><div class="text-blockUI-2">Please, wait.</div></div></div>'
css:
.image-blockUI
{
display: block;
margin-left: auto;
margin-right: auto;
height: 30px;
width: 24px;
background-image: url('../images/Edit.gif'); /* relative to the location where css file is */
}
.image-blockUI-container
{
display: inline;
width: 100px;
height: 100px;
}
@-webkit-keyframes fade-in{
from{
opacity:1;
top:0px;
}
to{
opacity:0;
top:-5px;
}
}
.text-blockUI
{
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
margin-top: 5px;
text-align: center;
display: inline;
position: relative;
top: 0px;
-webkit-animation: fade-in 1s infinite;
}
.text-blockUI-2
{
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
margin-top: 5px;
text-align: center;
opacity: 0;
display: inline;
position: relative;
margin-left: -56px;
-webkit-animation: fade-in 1s infinite;
-webkit-animation-delay: 0.5s;
}
I have tried to do the same explained here but without success (the accepted solution):
How to Fade In/Out multiple texts using CSS/jQuery like on Droplr?
What to fade in and out continuously and alternate those two phrases each time?