您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Auto hide BitMEX header for bigger view. Hover mouse to show back the header
当前为
- // ==UserScript==
- // @name BitMEX Header Auto-hide
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description Auto hide BitMEX header for bigger view. Hover mouse to show back the header
- // @author Nobakab
- // @match https://www.bitmex.com/*
- // @grant none
- // @require https://code.jquery.com/jquery-3.3.1.min.js
- // ==/UserScript==
- (function() {
- 'use strict';
- function addGlobalStyle(css) {
- var head, style;
- head = document.getElementsByTagName('head')[0];
- if (!head) { return; }
- style = document.createElement('style');
- style.type = 'text/css';
- style.innerHTML = css;
- head.appendChild(style);
- }
- function addExternalScript(js) {
- var head, script;
- head = document.getElementsByTagName('head')[0];
- if (!head) { return; }
- script = document.createElement('script');
- script.type = 'text/javascript';
- script.innerHTML = js;
- head.appendChild(script);
- }
- addGlobalStyle('.popUpChat {display: none}');
- //addGlobalStyle('#header {display: none}');
- var hideTimer;
- var showTimer = null;
- // Start after page loaded 3s
- setTimeout(function() {
- var header = $('#header');
- var tickerBar = $('.tickerBar');
- if (header && tickerBar) {
- // Hide it first time
- hideTimer = setTimeout(function() {
- $(header).hide();
- }, 2000);
- // Show it
- $(tickerBar).mouseover(function() {
- if (hideTimer) clearTimeout(hideTimer);
- if (!showTimer) {
- showTimer = setTimeout(function() {
- if (showTimer) {
- showTimer = null;
- $(header).show();
- }
- }, 500);
- }
- });
- // Hide after 1s moving out
- $(tickerBar).mouseout(function() {
- if (hideTimer) clearTimeout(hideTimer);
- if (showTimer) {
- clearTimeout(showTimer);
- showTimer = null;
- }
- hideTimer = setTimeout(function() {
- $(header).hide();
- }, 2000);
- });
- /*
- $(header).mouseenter(function() {
- if (hideTimer) clearTimeout(hideTimer);
- $(header).show();
- });
- // Hide after 1s moving out
- $(header).mouseout(function() {
- hideTimer = setTimeout(function() {
- $(header).hide();
- }, 1000);
- });
- */
- }
- }, 3000);
- })();