I want to make an automatic transition between divs.
Example:
div1 - show();
div2 - hide();
.... 3000milisegundoss ...
div1 - hide();
div2 - show();
And stay in this transition ...
I'm trying to do this, put it in a toggle()
it runs only once and stops.
How to make this transition automatic / "infinite"?
$(function(){
var div1 = $('.cliente1');
var div2 = $('.cliente2');
$(document).ready(function(){
div1.show();
div2.hide();
setInterval(function(){
div1.toggle();
div2.toggle();
}, 3000);
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><asideclass="clients cliente1" style="border: 1px solid black">
<div class="container">
<div class="row">
DIV 1
<div class="col-md-3 col-sm-6">
<a>
Conteúdo DIV 1
</a>
</div>
<div class="col-md-3 col-sm-6">
<a>
Conteúdo DIV 1
</a>
</div>
<div class="col-md-3 col-sm-6">
<a>
Conteúdo DIV 1
</a>
</div>
<div class="col-md-3 col-sm-6">
<a>
Conteúdo DIV 1
</a>
</div>
</div>
</div>
</aside>
<aside class="clients cliente2" style="border: 1px solid black">
<div class="container">
<div class="row">
DIV 2
<div class="col-md-3 col-sm-6">
<a>
Conteúdo DIV 2
</a>
</div>
<div class="col-md-3 col-sm-6">
<a>
Conteúdo DIV 2
</a>
</div>
<div class="col-md-3 col-sm-6">
<a>
Conteúdo DIV 2
</a>
</div>
<div class="col-md-3 col-sm-6">
<a>
Conteúdo DIV 2
</a>
</div>
</div>
</div>
</aside>