Last active
September 5, 2019 07:19
-
-
Save leMaur/637fef8846c6914fdee23cff08077933 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
(function (window, document) { | |
'use strict'; | |
let className = 'tabbing'; | |
let handleFirstTab = function (e) { | |
if (e.keyCode === 9) { | |
document.body.classList.add(className); | |
window.removeEventListener('keydown', handleFirstTab); | |
window.addEventListener('mousedown', handleMouseDownOnce); | |
} | |
} | |
let handleMouseDownOnce = function () { | |
document.body.classList.remove(className); | |
window.removeEventListener('mousedown', handleMouseDownOnce); | |
window.addEventListener('keydown', handleFirstTab); | |
} | |
window.addEventListener('keydown', handleFirstTab); | |
})(window, document); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment