function (clss, el) {
  if (isString(clss)) classList(el).add(clss)
  if (isObject(clss)) {
    var classArr = el.className.split(' ')
    var key
    for (key in clss) {
      if (classArr.indexOf(key) && clss[key] === false) classList(el).remove(key)
      if (clss.hasOwnProperty(key) && clss[key] === true) classList(el).add(key)
    }
  }
  if (isArray(clss)) {
    var i
    for (i = 0;i < clss.length; i++) {
      classList(el).add(clss[i])
    }
  }
}
function (clss, el) {
  if (isString(clss)) classList(el).add(clss)
  if (isObject(clss)) {
    var classArr = el.className.split(' ')
    var key
    for (key in clss) {
      if (classArr.indexOf(key) && clss[key] === false) classList(el).remove(key)
      if (clss.hasOwnProperty(key) && clss[key] === true) classList(el).add(key)
    }
  }
  if (isArray(clss)) {
    var i
    for (i = 0;i < clss.length; i++) {
      classList(el).add(clss[i])
    }
  }
}
function ( clss , el ) { if ( isString ( clss ) ) classList ( el ) . add ( clss ) if ( isObject ( clss ) ) { var classArr = el . className . split ( ' ' ) var key for ( key in clss ) { if ( classArr . indexOf ( key ) && clss [ key ] === false ) classList ( el ) . remove ( key ) if ( clss . hasOwnProperty ( key ) && clss [ key ] === true ) classList ( el ) . add ( key ) } } if ( isArray ( clss ) ) { var i for ( i = 0 ; i < clss . length ; i ++ ) { classList ( el ) . add ( clss [ i ] ) } } }
(clss → string | object | array, el → dom)
- add and remove class of element
( clss → string | object | array el → dom ) - add and remove class of element