您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
try to take over the world!
// ==UserScript== // @name 知乎标题隐藏 // @namespace http://tampermonkey.net/ // @version 0.2 // @description try to take over the world! // @author You // @match https://*.zhihu.com/* // @grant none // ==/UserScript== (function() { 'use strict'; document.getElementsByClassName('PageHeader')[0].style.display = 'none' windowAddMouseWheel(); function windowAddMouseWheel() { var scrollFunc = function (e) { e = e || window.event; if (e.wheelDelta) {//浏览器兼容 if (e.wheelDelta > 0) { //当滑轮向上滚动时 document.getElementsByClassName('Sticky')[0].style.display = 'block' } if (e.wheelDelta < 0) { //当滑轮向下滚动时 document.getElementsByClassName('Sticky')[0].style.display = 'none' } } else if (e.detail) { if (e.detail> 0) { //当滑轮向上滚动时 document.getElementsByClassName('Sticky')[0].style.display = 'block' } if (e.detail< 0) { //当滑轮向下滚动时 document.getElementsByClassName('Sticky')[0].style.display = 'none' } } }; //给页面绑定滑轮滚动事件 if (document.addEventListener) { document.addEventListener('DOMMouseScroll', scrollFunc, false); } //滚动滑轮触发scrollFunc方法 window.onmousewheel = document.onmousewheel = scrollFunc; } })();