Skip to content

Instantly share code, notes, and snippets.

@tylerbuchea
Created June 18, 2013 16:31
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 tylerbuchea/5806949 to your computer and use it in GitHub Desktop.
Save tylerbuchea/5806949 to your computer and use it in GitHub Desktop.
Adds transparent background to every node in the DOM. Allows for easy collision and overlap inspection. Ctrl-i toggles functionality.
// DOM Highlight (Ctrl-i)
$(function() {
$("<style type='text/css'> .DOMHighlight {background: rgba(0,0,0,0.1);} </style>").appendTo("head");
$('body').keypress(function(e) {
if (e.which === 9)
$('*').toggleClass('DOMHighlight');
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment