0
Fala galera!
I have the following code. What I’m trying to do is to randomly appear the 6 Ivs. I’ve tried to cross shapes but without result.
If anyone can help, thank you.
PS: I cannot put the Divs inside the HTML, it has to be via jquery.
var dfl1 = '<div class="col-xs-6 thumb">teste 1</div>'
var dfl2 = '<div class="col-xs-6 thumb">teste 2</div>'
var dfl3 = '<div class="col-xs-6 thumb">teste 3</div>'
var dfl4 = '<div class="col-xs-6 thumb">teste 4</div>'
var dfl5 = '<div class="col-xs-6 thumb">teste 5</div>'
var dfl6 = '<div class="col-xs-6 thumb">teste 6</div>'
var imagesdfl = [dfl1, dfl2, dfl3, dfl4, dfl5, dfl6];
$(imagesdfl[Math.floor(Math.random() * imagesdfl.length)]).appendTo('#load-content-d');
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="load-content-d" class="row thumbs gap-xs">
</div>
Thanks for the tip Bruno! Interesting this lib, but has no other method that does not have to use other libs?
– Eduardo
I put an example with pure javascript.
– Bruno Rigolon
Thank you very much Bruno!
– Eduardo
Eduardo, if solved, mark my answer as accepted for your problem. ;) A good weekend for you!
– Bruno Rigolon
Thanks Bruno! Have a nice weekend too.
– Eduardo