您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Show tags on hover.
当前为
// ==UserScript== // @name Tag Preview // @version 1.50 // @description Show tags on hover. // @author Hauffen // @include /https?:\/\/(e-|ex)hentai\.org\/.*/ // @require https://code.jquery.com/jquery-3.3.1.min.js // @namespace https://greasyfork.org/users/285675 // ==/UserScript== (function() { let $ = window.jQuery; const elem = {0: '.gl3m a', 1: '.gl3m a', 2: '.gl3c a', 4: '.gl3t a'}; var spl = document.URL.split('/'); var element, title; if ((spl[3].substr(0, 1).match(/[?#fptw]/i) && !spl[3].startsWith('toplist')) || !spl[3]) { var $tagP = $('<div id="tagPreview">'); $tagP.css({ position:'absolute', zIndex: '2', visiblility:'hidden !important', maxWidth: '400px', background: window.getComputedStyle(document.getElementsByClassName('ido')[0]).backgroundColor, border:'1px solid #000', padding: '10px' }); $tagP.appendTo("body"); $('#tagPreview').css('visibility', 'hidden'); element = elem[document.getElementsByTagName("select")[0].selectedIndex]; $('.itg').on('mouseover', `${element}`, function(e) { title = this.children[0].title; // Save the title so we can put it back later, probably unnecessary this.children[0].title = ""; // Clear the title so we don't have it over our new window var $content = $('<div>'); $content.load(this.href, function() { document.getElementById('tagPreview').innerHTML = $('#gd2', this).html() + $('#taglist', this).html(); var posY, posX = (e.pageX + 432 < screen.width) ? e.pageX + 10 : e.pageX - 412; var scrollHeight = $(document).height(); var scrollPosition = $(window).height() + $(window).scrollTop(); if ((scrollHeight - scrollPosition) < (scrollHeight / 10)) { posY = (e.pageY + 300 < scrollHeight) ? e.pageY + 10 : e.pageY - 300; } else { posY = e.pageY + 10; } $tagP.css({ left: posX, top: posY, border: '1px solid ' + window.getComputedStyle(document.getElementsByTagName("a")[0]).getPropertyValue("color"), visibility: 'visible' }); $('#tagPreview').css('visibility', 'visible'); }); }).on('mousemove', `${element}`,function(e) { var posY, posX = (e.pageX + 432 < screen.width) ? e.pageX + 10 : e.pageX - 412; var scrollHeight = $(document).height(); var scrollPosition = $(window).height() + $(window).scrollTop(); if ((scrollHeight - scrollPosition) < (scrollHeight / 10)) { posY = (e.pageY + document.getElementById('tagPreview').offsetHeight < window.innerHeight) ? e.pageY + 10 : e.pageY - 10 - document.getElementById('tagPreview').offsetHeight; } else { posY = e.pageY + 10; } $tagP.css({ visibility:'visible', top: posY, left: posX }); $('#tagPreview').css('visibility', 'visible'); }).on('mouseout', `${element}`, function() { this.children[0].title = title; // Put the saved title back $tagP.css({ visibility:'hidden' }); $('#tagPreview').css('visibility', 'hidden'); $tagP.empty(); }); $(document).on('scroll', function() { document.getElementById('tagPreview').style.visibility = 'hidden'; }); } else return; })();