Last active
January 1, 2017 03:10
-
-
Save nmsmith22389/538ec24d053fdf88fdcec0e23c221671 to your computer and use it in GitHub Desktop.
Disable input outline for mouse only
This file contains 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
$(document).ready(function() { | |
$("body").on("mousedown", "*", function(e) { | |
if (($(this).is(":focus") || $(this).is(e.target)) && $(this).css("outline-style") == "none") { | |
$(this).css("outline", "none").on("blur", function() { | |
$(this).off("blur").css("outline", ""); | |
}); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment