Created
May 13, 2015 04:50
-
-
Save loorlab/6345d727becdb75f5155 to your computer and use it in GitHub Desktop.
Random DIV with jQuery 2.1.3 DEMO : http://jsfiddle.net/jBzB4/118/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTML | |
<div id="container-mov"> | |
<div id="cammov1" class="swiper-slide">SLIDE 1</div> | |
<div id="cammov2" class="swiper-slide">SLIDE 2</div> | |
<div id="cammov3" class="swiper-slide">SLIDE 3</div> | |
<div id="cammov4" class="swiper-slide">SLIDE 4</div> | |
<div id="cammov5" class="swiper-slide">SLIDE 5</div> | |
<div id="cammov6" class="swiper-slide">SLIDE 6</div> | |
</div> | |
JS | |
var divsCollection = $("#container-mov"); | |
var container = $(divsCollection).find('.swiper-slide'); | |
var divs = container.get().sort(function(){ | |
return Math.round(Math.random()); | |
}); | |
$(divsCollection).html(divs); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment