Created
January 29, 2018 06:56
-
-
Save shmdhussain/f0da910dec9572fa4facfd3cf8ff2a76 to your computer and use it in GitHub Desktop.
In Chrome clicking "h" key in elements tab of devtools panel should toggle the hide/show
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
var cssRule = `.__web-inspector-hide-shortcut__, .__web-inspector-hide-shortcut__ * { | |
display: none !important; | |
}`; | |
function injectStyleRulejQ(rule, id) { | |
var div = $("<div />", { | |
html: '­<style id=' + id + '>' + rule + '</style>' | |
}).appendTo("body"); | |
div.hide(); | |
} | |
function injectStyleRule(rule, id) { | |
var elem = document.createElement('div'); | |
elem.innerHTML = "<style>" + rule + "</style>"; | |
elem.id=id; | |
elem.style.cssText = 'display:none'; | |
document.body.appendChild(elem); | |
} | |
injectStyleRule(cssRule, "display-none-shortcut"); | |
//https://stackoverflow.com/questions/34938460/is-there-a-shortcut-to-toggle-display-none-block-in-elements-style-in-chrome |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment