classtime
v1.0.0
Published
An uber minimal set of class manipulation methods
Downloads
5
Readme
classtime
A handful (literally) of class list manipulation functions
API
hasClass(classes, name)
Returns true
if name
is found in the list of classes
removeClass(classes, name)
Removes name
from classes
addClass(classes, name)
Adds name
to classes
if it's not already there
toggleClass(classes, name)
Add name
to classes
if not found, otherwise removes it
swapClasses(classes, a, b)
If a
is found in classes
, remove it and add b
, otherwise remove b
and add a
That's it. Nothing more to see here. Move along.