Skip to content

Instantly share code, notes, and snippets.

@rdy4ever
Last active January 26, 2018 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rdy4ever/7db2b5cc5f02d40b489fbc9fab5097d4 to your computer and use it in GitHub Desktop.
Save rdy4ever/7db2b5cc5f02d40b489fbc9fab5097d4 to your computer and use it in GitHub Desktop.
simple outliner
document.onkeydown = TabPress;
function TabPress(evt) {
var evt = (evt) ? evt : ((event) ? event : null);
var tabKey = 9;
if(evt.keyCode == tabKey) {
document.body.className += ' ' + 'accesibility';
}
}

simple outliner

A simple way to remove the outline for regular users but enable it for keybord navigators.

A Pen by Horia Rudan on CodePen.

License.

<body>
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
<a href="#">Link 4</a>
</body>
body:not(.accesibility) a{
outline:none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment