classrotationexample

Example of the class rotation jquery plugin @github.com/jackphilippi/classrotation

by Jack Philippi

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://dl.dropboxusercontent.com/u/19449337/rotate/classrotation/rotate.js"></script>
<div id="click" class="green">
This div's background color will change!
</div>

CSS

.red { background-color: red; }
.blue { background-color: blue; }
.green { background-color: green; }
.yellow { background-color: yellow; }
.orange { background-color: orange; }

JavaScript

// listen for a click on the div
$("div#click").click(function () {
    // define your array of classes here
    var x = ["blue", "green", "yellow", "red", "orange"];
    $().rotate(x);
});