Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var createFocusTrap = require('../../');
var containerOne = document.getElementById('demo-one');
var focusTrapOne = createFocusTrap('#demo-one', {
onDeactivate: function () {
containerOne.className = 'trap';
},
});
document.getElementById('activate-one').addEventListener('click', function () {
focusTrapOne.activate();
containerOne.className = 'trap is-active';
});
document.getElementById('deactivate-one').addEventListener('click', function () {
focusTrapOne.deactivate();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.