Skip to content

Instantly share code, notes, and snippets.

@lmmx
Last active August 29, 2015 14:10
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 lmmx/b5d65dc58663c38cb984 to your computer and use it in GitHub Desktop.
Save lmmx/b5d65dc58663c38cb984 to your computer and use it in GitHub Desktop.
Bookmarklets: save them as bookmarks (the code instead of a web address), Javascript is executed upon clicking, modifying the page display. Clicking the button again will remove the CSS script from the page - the same variable name, "hidecss" is used to avoid any potential mixups if two different bookmarklets are accidentally clicked. The CSS st…
javascript:(function(){var hidecss = "div#content {width:100%} div#content-journalnav { width: 100%; } * { font-family: Myriad Pro; }"; if (document.querySelector('#hidecss')===null){ var hidescript = document.createElement('style'); hidescript.type = 'text/css'; hidescript.id = 'hidecss'; hidescript.innerHTML = hidecss; document.head.appendChild(hidescript); } else document.getElementById('hidecss').remove();})();
javascript:(function(){var hidecss = ".seven_col { width: 85.3333%; }"; if (document.querySelector('#hidecss')===null){ var hidescript = document.createElement('style'); hidescript.type = 'text/css'; hidescript.id = 'hidecss'; hidescript.innerHTML = hidecss; document.head.appendChild(hidescript); } else document.getElementById('hidecss').remove();})();
javascript:(function(){var hidecss = "body { max-width: 100% !important; width: 2000px !important; } html { max-width: 100%; } * { font-family: Myriad Pro; font-size: 100% !important; } div#centerPane { width: 100% !important; } div#leftPane { display: none; } div#articleToolbar { display: none; } #centerContent p { font-size: 165% !important; line-height: 1.4; } "; if (document.querySelector('#hidecss')===null){ var hidescript = document.createElement('style'); hidescript.type = 'text/css'; hidescript.id = 'hidecss'; hidescript.innerHTML = hidecss; document.head.appendChild(hidescript); } else document.getElementById('hidecss').remove();})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment