您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Toggles the background colour for images in the browser
当前为
- // ==UserScript==
- // @name Image BG Toggle
- // @namespace PXgamer
- // @version 0.4
- // @description Toggles the background colour for images in the browser
- // @author PXgamer
- // @include *.png*
- // @include *.jpg*
- // @include *.gif*
- // @require https://code.jquery.com/jquery-1.12.3.min.js
- // @grant none
- // ==/UserScript==
- /*jshint multistr: true */
- (function() {
- 'use strict';
- var col = false;
- $('body').append('<span class="bgToggle" style="cursor: pointer; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; z-index: 999999; float: right; background-color: white; border: 1px solid grey; border-radius: 2px; margin: 5px; padding: 2px; font-family: fantasy;">TOGGLE BG</span>');
- $('.bgToggle').on('click', function() {
- if (!col) {
- $('body').css('background-color', 'black');
- col = true;
- }
- else {
- $('body').css('background-color', 'white');
- col = false;
- }
- });
- })();