Created
November 6, 2017 04:59
-
-
Save ryngonzalez/4b19413b7eeaa5812beafb8235a7ccb9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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