您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
lalala
当前为
// ==UserScript== // @name 去刷屏 // @namespace http://tampermonkey.net/ // @version 0.1 // @description lalala // @author miaomiao // @match http://bbs.jjwxc.net/board.php?board=*&type=*&page=* // @match http://bbs.jjwxc.net/showmsg.php?board=*&boardpagemsg=*&id=* // @grant none // ==/UserScript== (function() { 'use strict'; // Your code here... $("[id=topic]").each(function(index, element) { var text = $(element).text(); var flag = text.length > 200 ? true: false; if (flag) { $(element).html(""); $(element).append("<p>" + text.substring(0, 200) + "<span id='hide"+index+"' style='display:none'>" + text.substring(200) + "</span>" + "<a href='javascript:;' id='open"+index+"'>...显示全部</a></p>"); } $("#open"+index).click(function() { if (flag) { $("#open"+index).text("...隐藏"); $("#hide"+index).show(); flag = false; } else { $("#open"+index).text("...显示全部"); $("#hide"+index).hide(); flag = true; } }); }); })();