您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
On the Mozilla Support site, change the top menus to show on click rather than mouseover, subdue the background colors
- // ==UserScript==
- // @name SuMo Top Menu Hover Remover
- // @description On the Mozilla Support site, change the top menus to show on click rather than mouseover, subdue the background colors
- // @author Jefferson "jscher2000" Scher
- // @namespace JeffersonScher
- // @copyright Copyright 2016 Jefferson Scher (5/5/2016)
- // @license BSD 3-clause
- // @include https://support.mozilla.org/*
- // @version 0.5
- // @grant none
- // ==/UserScript==
- // Modify CSS hover menus to open and close with a click
- var menupads = document.querySelectorAll('#aux-nav > ul > li');
- for (var i=0; i<menupads.length; i++){
- var droplist = menupads[i].querySelector('ul');
- if (droplist) { // remove href and attach toggle function
- var link = menupads[i].querySelector("a");
- link.href = "javascript:void(0);";
- link.addEventListener("click", updateMenus, false);
- link.title = "Open menu";
- }
- }
- // Style changes
- /* Override this hover rule that shows the drop menu
- #aux-nav > ul > li:hover > ul {
- display: block;
- }
- */
- var r = "#aux-nav > ul > li:hover > ul {display:none;} ";
- /* Make the background colors less jarring
- #aux-nav > ul > li:hover {
- background: #fff;
- }
- #aux-nav > ul > li > a:hover {
- background-color: #fff;
- #aux-nav > ul > li > ul {
- background: #fff;
- }
- */
- r += "#aux-nav > ul > li:hover, #aux-nav > ul > li > a.menuopen, #aux-nav > ul > li > ul {background-color:#d2e9fc !important;} #aux-nav > ul > li > a:hover {background-color:transparent !important;}";
- var s = document.createElement("style");
- s.type = "text/css";
- s.appendChild(document.createTextNode(r));
- document.body.appendChild(s);
- function updateMenus(evt){
- // Event is on a link element
- var ael = evt.target;
- var opened = toggleSiblingList(ael);
- if (opened){ // close other open lists, if any
- var nowopen = document.getElementsByClassName('menuopen');
- if (nowopen.length > 1) {
- for (var i=0; i<nowopen.length; i++) {
- if (nowopen[i] != ael) toggleSiblingList(nowopen[i]);
- }
- }
- }
- return false;
- }
- function toggleSiblingList(ael){
- var siblist = ael.nextElementSibling;
- if (siblist){
- if (siblist.style.display != "block"){
- siblist.style.display = "block";
- if (ael.className) ael.className += " menuopen";
- else ael.className = " menuopen";
- ael.title = "Close menu";
- return true;
- } else {
- siblist.style.display = "none";
- if (ael.className) ael.className = ael.className.replace(" menuopen", "");
- ael.title = "Open menu";
- return false;
- }
- } else {
- return false;
- }
- }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址