rendered paste body<html>
<head>
<script>
var visorTexto;
function mostrar(codigo) {
var divMostrar = document.getElementById("div" + codigo);
var spanMostrar = document.getElementById("span" + codigo);
var anchoDiv = divMostrar.offsetWidth;
var anchoDentro = spanMostrar.offsetWidth;
if (anchoDiv<anchoDentro) {
visorTexto.innerHTML = spanMostrar.childNodes[0].nodeValue;
var altoDiv = divMostrar.offsetHeight;
var posXactual = 0;
var posYactual = 5;
while (divMostrar != null) {
posXactual += divMostrar.offsetLeft;
posYactual += divMostrar.offsetTop;
divMostrar = divMostrar.offsetParent;
}
var maxAncho = window.document.body.clientWidth;
var anchoVisor = (anchoDentro > maxAncho) ? maxAncho : anchoDentro;
if (maxAncho < posXactual + anchoVisor) {
posXactual = maxAncho - anchoVisor;
}
visorTexto.style.left = posXactual + "px";
visorTexto.style.top = (posYactual + altoDiv) + "px";
visorTexto.style.width = anchoVisor + "px";
visorTexto.style.visibility="";
visorTexto.style.display="block";
}
}
function ocultar() {
visorTexto.style.visibility = "hidden";
visorTexto.style.display = "none";
}
function cambiaAncho() {
document.getElementById("cuerpo").style.width = document.getElementById("ancho").value + "px";
}
function iniciar() {
visorTexto = document.getElementById("visorTexto");
}
</script>
</head>
<body onload="iniciar();">
<span id="cuerpo" style="position: absolute;">
<table cellpadding="0" cellspacing="5" border="0" style="width: 100%;">
<tr>
<td style="width: 50%;" onmouseover="mostrar(1);" onmouseout="ocultar();">
<div id="div1" style="width: 100%; border: 1px solid #FF0000; overflow: hidden;">
<span id="span1" style="white-space: nowrap;">
qweqwe qweqwe qweqwe qwe1
</span>
</div>
</td>
<td style="width: 50%;" onmouseover="mostrar(2);" onmouseout="ocultar();">
<div id="div2" style="width: 100%; border: 1px solid #FF0000; overflow: hidden; white-space: nowrap;">
<span id="span2" style="white-space: nowrap;">
qweqwe qweqwe qweqwe qweqwe qweqwe qwe qweqw eqwe qwe qw2
</span>
</div>
</td>
</tr>
</table>
</span>
<div style="position: absolute; top: 200px;">
<input type="text" id="ancho">
<button onclick="cambiaAncho();">Cambia</button>
</div>
<span id="visorTexto" style="position: absolute; z-index: 1000; background-color: #0000C0; color: #FFFFFF; visibility: hidden; display: none;"></span>
</body>
</html>