1.0.0 • Published 8 years ago

jq-classrotation v1.0.0

Weekly downloads
2
License
-
Repository
github
Last release
8 years ago

jq-classrotation

The classrotation jQuery plugin allows the rotation of specific user-defined classes in a html page. In order to use this plugin, you will need to set up your classes in a css stylesheet. The plugin parses an array of user-specified classes and swaps all occurences of the 'current' class with the next in the array.

Usage

  1. Clone the plugin into your project's global namespace
  2. Create a few classes
  3. Create an element in your DOM with one of your classes
  4. Create a jquery event i.e. $('#clickme').click(function(){...});
  5. Inside the event, instantiate an array of your classes i.e.var array = ["blue", "green", "yellow"]; and then call the $().rotate(array); function (taking your array as a parameter).
  6. Trigger your event
Example

An extremely basic implementation looks something like this: https://jsfiddle.net/jackphilippi/0x39Lmex/