Greasy Fork is available in English.
自动折叠 NGA 版头/版规/置顶部分,需要的时候可以点击版头按钮显示(替换跳转功能)
当前为
// ==UserScript==
// @name NGA 版头/版规/置顶部分折叠
// @namespace http://greasyfork.icu/zh-CN/users/164691-shy07
// @version 0.2
// @description 自动折叠 NGA 版头/版规/置顶部分,需要的时候可以点击版头按钮显示(替换跳转功能)
// @author Shy07
// @require https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.18.2/babel.js
// @require https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.16.0/polyfill.js
// @match http://nga.178.com/*
// @grant none
// jshint esversion:6
// ==/UserScript==
(function() {
'use strict';
// Your code here...
const toppedTopic = document.querySelector('#toppedtopic');
console.log(toppedTopic.style);
toppedTopic.style.display = 'none';
const toggle = () => toppedTopic.style.display = toppedTopic.style.display === 'none' ? 'block': 'none';
const container = document.querySelector('#toptopics .small_colored_text_btn');
container.href = 'javascripts:;';
container.addEventListener('click', toggle);
})();