1 608
edições
Sem resumo de edição |
Sem resumo de edição |
||
| Linha 27: | Linha 27: | ||
tip.className = "item-tooltip"; | tip.className = "item-tooltip"; | ||
tip.innerHTML = | |||
'<img class="icon" src="' + API + item.icon + '">' + | |||
'<div class="text">' + | |||
'<b>' + item.name + '</b><br>' + | |||
roColorToHtml(item.description) + | |||
'</div>'; | |||
document.body.appendChild(tip); | document.body.appendChild(tip); | ||
var move = function (ev) { | var move = function (ev) { | ||
var x = ev.clientX + | var x = ev.clientX + 20; | ||
var y = ev.clientY + | var y = ev.clientY + 20; | ||
if (x + 280 > window.innerWidth) | |||
if (x + | x = ev.clientX - 300; | ||
x = ev.clientX - | |||
if (y + | if (y + 120 > window.innerHeight) | ||
y = ev.clientY - | y = ev.clientY - 140; | ||
tip.style.left = x + "px"; | tip.style.left = x + "px"; | ||