Last active
March 7, 2016 15:53
Revisions
-
AntonTrollback revised this gist
Jan 7, 2015 . 3 changed files with 39 additions and 18 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,18 +0,0 @@ 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ a { color: rebeccapurple; text-decoration: none; outline: 0; } a:hover, a:active { color: rebeccapurple; text-decoration: underline; } html.tabbing a:focus { outline: 2px solid; text-decoration: none; } 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ $(function() { var $root = $('html'); var tabbing, code; $(document).on('mousedown keydown', function (e) { if (e.type === 'mousedown') { tabbing = false; return; } code = e.keyCode ? e.keyCode : e.which; if (code == 9) { tabbing = true; } }); $('a, button, input[type="submit"]').on('focus', function (e) { $root.toggleClass('tabbing', tabbing); }); }); -
AntonTrollback created this gist
Mar 11, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ // Tested in IE8 and Firefox // // Along with this css: // a:active { outline: none } // a:focus { outline: 1px dotted } $(function() { $(document).on({ 'mousedown' : function(e) { $(this).css('outline', 'none'); }, 'mouseup' : function(e) { $(this).css('outline', '').blur(); } }, 'a, button, input[type="submit"]'); });