Floating Menu Bar (GitHub)

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

Pada tanggal 30 Januari 2016. Lihat %(latest_version_link).

  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.0
  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.z-index = '10000';
  16. menu[0].style.width = '100%';
  17. var content = document.getElementsByClassName('main-content');
  18. if (content.length) {
  19. menu[0].style.position = 'relative';
  20. menu[0].style.top = '50px';
  21. }
  22. }
  23. })();