Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (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);
Add Comment
Please, Sign In to add comment