1.1.1 • Published 3 years ago

dynamic-user-interface-interactions v1.1.1

Weekly downloads
11
License
ISC
Repository
github
Last release
3 years ago

const div = document.querySelector('.root'); const btn = document.querySelector('.btn');

function displayOpts() { const opts = document.querySelectorAll('.option'); opts.forEach((opt) => { const el = opt el.style.display = 'block'; }); }

function hideOpts() { const opt = document.querySelectorAll('.option'); // eslint-disable-next-line no-return-assign opt.forEach((op) => { const elem = op; elem.style.display = 'none'; }); } btn.addEventListener('mouseover', displayOpts); btn.addEventListener('mouseleave', hideOpts);

exports.dropDown = function () { return { displayOpts, hideOpts } }