lazy-class
v0.1.3
Published
Lazy add classes to DOM elements
Downloads
14
Readme
Lazy-Class.js
Lazy append classes to DOM elements.
npm
Install Lazy Class, and add it to your package.json
dependencies.
$ npm i lazy-class --save
Lazy Add Classes
import { lazy } from 'lazy-class'
Usage
let oscar = document.querySelector('.award')
let oscars = document.querySelectorAll('.awards')
lazy(oscar, 'won', 600)
lazy(oscars, 'nominated', 900)
lazy(oscar, 'nominated', 900, {
change: 'add'
})
lazy(oscar, 'nominated', 1200, {
change: 'remove'
})
MIT License