@ampify/utils
v0.1.2
Published
Utilities to use in plugins.
Downloads
23
Readme
Ampify Utils
Utilities to use in plugins.
togglify
Generate amp toggle events on targets
Accepts object:
el
- The element to taptargets
- Array of objects with el and class to toggle
Example:
const el = document.querySelector('.hamburger');
const targets = [
{
el: document.querySelector('#menu'),
className: 'active'
},
{
el: document.querySelector('#submenu'),
className: 'is-open'
}
];
toggle({ el, targets });