Tumblr No Scrolling Header

Pins scrolling header to the top of the page.

当前为 2015-05-08 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Tumblr No Scrolling Header
// @namespace   TNSH
// @description Pins scrolling header to the top of the page.
// @include     https://www.tumblr.com/*
// @version     3
// @grant       GM_addStyle
// @license     GNU GPL v3
// ==/UserScript==

// SETTINGS
// Set to "true" if you want to pin the scrolling header to the top of the page, set to false otherwise
var pinScrollingHeader = true;
// Set to "true" if you want to hide the old button strip, set to false otherwise
var hideOldPostButtons = false;
// END OF SETTINGS

if (pinScrollingHeader){
	var h = document.getElementsByClassName("l-header-container l-header-container--refresh");
	if (h.length >= 1)
		h[0].style.position = "absolute";	
	GM_addStyle(".l-header-container{position:absolute !important;}")
}

if (hideOldPostButtons){
	var h = document.getElementById("new_post_buttons");
	if (h)
		h.style.display = "none";
}