Greasy Fork

Window floating container

Adds a fixed header element for use by other scripts

目前为 2016-03-24 提交的版本。查看 最新版本

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.greasyfork.icu/scripts/18233/115233/Window%20floating%20container.js

// ==UserScript==
// @name         Window floating container 
// @version      0.1
// @description  Adds a fixed header element for use by other scripts
// @author       @_jnblog
// @require      https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js
// @grant        GM_addStyle
// ==/UserScript==
/* jshint -W097 */
/* global $ */
/* jshint asi: true, multistr: true */
'use strict'


GM_addStyle('#ijgWindowFloater {\
  position: fixed;\
  top: 0;\
  left: 0;\
  z-index: 2000;\
  color: white;\
  background-color: green;\
}')

GM_addStyle('.ijgWindowFloater-item {\
}')
GM_addStyle('.ijgWindowFloater-item + .ijgWindowFloater-item {\
  padding-left: 1em;\
}')

var ijgFloater = $('#ijgWindowFloater')
if (!ijgFloater) {
  ijgFloater = $('<div id="ijgWindowFloater">')
  $('body').prepend(ijgFloater)
}

function getFloater() {
  return ijgFloater
}