Nová ukázka
Reset
Načíst z URL
Uložit a získat odkaz
Vztahuje se k…
Nevyplňujte
Napiště „nejsem robot“
▶
Přepnout zobrazení
Výsledek
<a href="#" >Diskusia JPW</a>
HTML
Autoformát
Standardní režim
Mobilní zobrazení
[data-preview] { /*display: block!important;*/ box-shadow: 4px 6px 16px -1.2px silver; } a { display: block; background: #eef; text-align: center; width: 25%; padding: 12px; margin: 8% auto; }
CSS
Autoformát
CSS reset
Až na konci
var imgobj = document.createElement("img"); imgobj.src = "http://jimpunk.net/Loading/wp-content/uploads/loading83.gif"; imgobj.setAttribute("data-preview", '1'); imgobj.style.position = "absolute" ; imgobj.style.display = "none"; document.body.appendChild(imgobj); var loadimage = function (url) { imgobj.setAttribute("src",url); imgobj.style.display = "block"; moveimage(event); } var moveimage = function (e) { var posx = 0; var posy = 0; if (e.pageX || e.pageY) { posx = e.pageX; posy = e.pageY; } else if (e.clientX || e.clientY) { posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; } // posx and posy contain the mouse position relative to the document // Do something with this information itop=posy+"px"; ileft=posx+"px"; imgobj.style.top=itop; imgobj.style.left=ileft; } var hideimage = function () { imgobj.style.display="none"; } // zabezpečí obrázok var tmpA = document.getElementsByTagName("a")[0]; tmpA.onmouseover = function(){ loadimage('http://diskuse.jakpsatweb.cz/img/logo.png'); }; tmpA.onmouseout = hideimage;
J
ava
S
cript
Autoformát
jQuery
Umístění JS
window.onload
</head>
</body>