Greasy Fork

Greasy Fork is available in English.

预览网页,悬停1.5s在本页面预览将要跳转的网页

该脚本能够让你不点击链接的情况下,在本页面预览链接的页面内容,你只需要鼠标悬停在超链接上1.5s即可。

当前为 2018-10-01 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         预览网页,悬停1.5s在本页面预览将要跳转的网页
// @namespace    https://github.com/zhchjiang95
// @version      0.1
// @description  该脚本能够让你不点击链接的情况下,在本页面预览链接的页面内容,你只需要鼠标悬停在超链接上1.5s即可。
// @author       zhchjiang95 <[email protected]>
// @include      http://*
// @include	     https://*
// @require      https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js
// @match        http://*
// @match        https://*
// @grant        none
// ==/UserScript==

var div = $("<div id='preview-a'></div>"),
    iframe = $("<iframe name='link'></iframe>"),
    p = $("<p>×</p>");
var parentDiv = div.append(iframe).append(p);
var timer,istrue=false;
$("a").attr("target","link");
$("a").mouseover(function(){
    if(istrue) return;
    var athis = $(this)[0];
    timer = setTimeout(function(){
        $('body').append(parentDiv);
        sty();
        athis.click();
        istrue = true;
    },1500);
});
$("a").mouseout(function(){
    //$("#preview-a").remove();
    clearTimeout(timer);
});
$("body").on('click','#preview-a p',function(){
    $(this).parent().remove();
    istrue = false;
})
function sty(){
    $("#preview-a").css({
        'background': '#eee',
        'position': 'fixed',
        'width': '70%',
        'height': '60%',
        'border': '2px solid #f1f1f1',
        'border-radius': '8px',
        'z-index': 9999999,
        'overflow': 'hidden',
        'top': '38%',
        'left': '29%'
    })
    $("#preview-a iframe").css({
        'border': 'none',
        'width': '100%',
        'height': '100%',
    });
    $("#preview-a p").css({
        'width': '24px',
        'height': '24px',
        'line-height': '23px',
        'background': 'red',
        'border-radius': '50%',
        'color':'#ffffff',
        'font-size':'20px',
        'text-align':'center',
        'cursor': 'pointer',
        'position':'absolute',
        'top':'48%',
        'left':10,
        'z-index': '999999'
    });
}