hover for link

try to take over the world!

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         hover for link
// @namespace    https://github.com/Khdoop
// @version      0.5
// @description  try to take over the world!
// @author       Khdoop
// @match        *://*/*
// @grant        none
// @require      https://code.jquery.com/jquery-3.1.1.min.js
// ==/UserScript==


var body = $(document.body);
console.log('1111111', body);
var anchors = body.find('a');
var box = $('<div class="link-tooltip"></div>').appendTo(body);

box.css({
	display: 'block',
	position: 'absolute',
	right: 0,
	padding: '5px',
	'font-size': '18px',
	background: 'white',
	border: '1px solid black',
	opacity: 0.9,
	'word-break': 'break-all',
	'z-index': 99999
});

anchors.on('mouseover', function() {
	box.css({display: 'block', bottom: body.scrollTop() * -1}).text($(this)[0].href);
}).on('mouseleave', function() {
	box.css({display: 'none'});
});