A simple way to do this is like this:
<div id="el">
<h1>TEXTO DE EXEMPLO 1</h1>
<h1>TEXTO DE EXEMPLO 2</h1>
<h1>TEXTO DE EXEMPLO 3</h1>
</div>
Script:
(function(){
var el = document.getElementById('el'),
total = el.children.length, t = 1000, count=0;
setInterval(function() {
for (var j=0; j < total; j++) {
el.children[j].removeAttribute("class");
}
el.children[count].setAttribute("class", "active");
count++;
if (count == total) {
count=0;
}
}, t);
})();
to interrupt at last:
(function(){
var el = document.getElementById('el'), total = el.children.length, t = 1000, count=0;
var interval = setInterval(function() {
for (var j=0; j < total; j++) {
el.children[j].removeAttribute("class");
}
el.children[count].setAttribute("class", "active");
count++;
if (count == total) {
clearInterval(interval);
}
}, t);
})();
Css:
#el h1 {
display:none;
}
#el h1.active {
display:block;
}
Continuous example in jsfiddle.
Broken example in jsfiddle.
This is like "do it for me," it could show what you’ve tried?
– Guilherme Lautert
I haven’t tried anything because I don’t know how it does :/ I think it’s something like doing in js to make it appear after a second, last a second to appear the other.
– Júlio
It would be interesting to add a [mcve]. So it’s easier for us to simulate your problem in something you’ve already done. :)
– user28595
The question is specific (describes well what you want), is relevant to others (because it has wide application) and is in context in the OS. In this case, I don’t know why "do it for me" makes this a bad question. O Minimum, Complete and Verifiable Example applies to questions about a problem in the code, not to questions that even have code.
– rodorgas
@rodorgas It is precisely because there is no code that the intention is doubtful. If he doesn’t even know where to start, the best he can do is study and not ask for the code :)
– DH.