var div500 = document.querySelector("#sec120");
var div501 = document.querySelector("#sec121");
var div502 = document.querySelector("#sec122");
function op100() {
if (div500.style.display == "block") {
div500.style.display="none";
div501.style.display="none";
div502.style.display="none";
} else {
div500.style.display="block";
div501.style.display="none";
div502.style.display="none";
}
}
function op101() {
if (div501.style.display == "block") {
div500.style.display="none";
div501.style.display="none";
div502.style.display="none";
} else {
div500.style.display="none";
div501.style.display="block";
div502.style.display="none";
}
}
function op102() {
if (div502.style.display == "block") {
div500.style.display="none";
div501.style.display="none";
div502.style.display="none";
} else {
div500.style.display="none";
div501.style.display="none";
div502.style.display="block";
}
}
function op200() {
var opfx20 = []
opfx20[0] = op100();
opfx20[1] = op101();
opfx20[2] = op102();
var opn30 = 0;
if (opn30 < opfx20.length - 1) {
opn30++;
} else {
opn30 = 0;
}
}
setInterval(op200, 1500);
<style type="text/css">
#bd300 {margin:0px;}
#sec120, #sec121, #sec122 {text-align: center;
padding: 80px 20px 80px 20px;
margin: 15px 0px 15px 0px;
background: #ccc;
display: none;}
#sec300 {position: fixed;
left: 0px;
right: 0px;
top: 0px;
padding: 50vh 0vh 0vh 0vh;
text-align: center;
}
</style>
<section id="sec120">
<div id="div220">
<p> Section 1</p>
</div>
</section>
<section id="sec121">
<div id="div221">
<p> Section 2</p>
</div>
</section>
<section id="sec122">
<div id="div222">
<p> Section 3</p>
</div>
</section>
<section id="sec300">
<button onclick="op100();"> Section 1 </button>
<button onclick="op101();"> Section 2 </button>
<button onclick="op102();"> Section 3 </button>
<button onclick="op200();"> Section all </button>
</section>
Brothers ... hello everyone! One question ... I'm practicing and trying to make a slider ... and I have this that you see ...
What I intend is that the setInterval execute the functions op100, op101, op102 one behind the other, and the result is that the op102 function is executed immediately without going through the other 2 first ... they know how to do that ...?
the function of the interval is op200 ().
that I must correct to run
op100 () - > ends and begins - > op101 () - > ends and begins - > op102 ().
???
Gracais beforehand! bn dia.!