Last active
December 9, 2017 20:14
-
-
Save luiseduardobraschi/73b9f65eb4f8728858f7e0e43f876de3 to your computer and use it in GitHub Desktop.
A bookmarklet to quickly toggle admin bar in WordPress .
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
javascript: (function() { | |
var htmlStyle = document.documentElement.style; | |
var adminBarStyle = document.getElementById('wpadminbar').style; | |
if(undefined == window.hasAdminBar){ | |
window.hasAdminBar = true; | |
} | |
var cssText, display; | |
if(window.hasAdminBar) { | |
cssText = 'margin-top:0px !important'; | |
display = 'none'; | |
} else { | |
cssText = 'margin-top:32px !important'; | |
display = 'block'; | |
} | |
htmlStyle.cssText = cssText; | |
adminBarStyle.display = display; | |
window.hasAdminBar = !window.hasAdminBar; | |
})(); |
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
javascript:(function(){var htmlStyle=document.documentElement.style,adminBarStyle=document.getElementById("wpadminbar").style;void 0==window.hasAdminBar&&(window.hasAdminBar=!0);var cssText,display;window.hasAdminBar?(cssText="margin-top:0px !important",display="none"):(cssText="margin-top:32px !important",display="block"),htmlStyle.cssText=cssText,adminBarStyle.display=display,window.hasAdminBar=!window.hasAdminBar})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment