Window floating container

Adds a fixed header element for use by other scripts

当前为 2016-03-24 提交的版本,查看 最新版本

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/18233/115264/Window%20floating%20container.js

  1. // ==UserScript==
  2. // @name Window floating container
  3. // @version 0.1
  4. // @description Adds a fixed header element for use by other scripts
  5. // @author @_jnblog
  6. // @require https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js
  7. // @grant GM_addStyle
  8. // ==/UserScript==
  9. /* jshint -W097 */
  10. /* global $ */
  11. /* jshint asi: true, multistr: true */
  12. 'use strict'
  13.  
  14.  
  15. GM_addStyle('#ijgWindowFloater {\
  16. position: fixed;\
  17. top: 0;\
  18. left: 0;\
  19. z-index: 2000;\
  20. color: white;\
  21. background-color: #EB6841;\
  22. }')
  23.  
  24. GM_addStyle('#ijgWindowFloater a {\
  25. color: white !important;\
  26. padding: 2px;\
  27. display: inline-block;\
  28. }')
  29. GM_addStyle('.ijgWindowFloater-item + .ijgWindowFloater-item {\
  30. padding-left: 1em;\
  31. }')
  32.  
  33. var ijgFloater = $('#ijgWindowFloater')
  34. if (!ijgFloater.length) {
  35. ijgFloater = $('<div id="ijgWindowFloater">')
  36. $('body').prepend(ijgFloater)
  37. }
  38.  
  39. function getFloater() {
  40. return ijgFloater
  41. }