Floating Menu Bar (GitHub)

Makes the menu bar in GitHub stay at the top of the page when scrolling

Versione datata 07/02/2016. Vedi la nuova versione l'ultima versione.

  1. // ==UserScript==
  2. // @name Floating Menu Bar (GitHub)
  3. // @namespace chriskim06
  4. // @description Makes the menu bar in GitHub stay at the top of the page when scrolling
  5. // @include https://github.com/*
  6. // @version 1.0.2
  7. // @grant none
  8. // @locale en
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. var menu = document.getElementsByClassName('header header-logged-in true');
  13. if (menu.length) {
  14. menu[0].style.position = 'fixed';
  15. menu[0].style.zIndex = '10000';
  16. menu[0].style.width = '100%';
  17. var content = document.getElementsByClassName('main-content');
  18. if (content.length) {
  19. content[0].style.position = 'relative';
  20. content[0].style.top = '50px';
  21. }
  22. content = document.getElementsByClassName('container');
  23. var footer = content.item(content.length - 1);
  24. if (footer !== null) {
  25. footer.style.position = 'relative';
  26. footer.style.top = '50px';
  27. }
  28. }
  29. })();