Created
August 30, 2016 09:31
-
-
Save koentjuh1/5912261c6e4b0d79d4e0ef4db9f968f8 to your computer and use it in GitHub Desktop.
Random addClass acitve
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
<div class="carousel-inner" role="listbox"> | |
<div class="item" style="background-image: url("images/slider1.jpg");"> | |
</div> | |
<div class="item" style="background-image: url("images/slider2.jpg");"> | |
</div> | |
<div class="item" style="background-image: url("images/slider3.jpg");"> | |
</div> | |
</div> |
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
$('.item').eq(Math.floor((Math.random() * $('.item').length))).addClass("active"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment