Using a script to popup message boxes when "onMouseOver"
event occurs.
Problem is that the box pops up at a seamingly random location, sometimes outside the window and thus not visible. I would like the box to open near the
mouse-pointer.
These are the scripts involved:
Thanks !
event occurs.
Problem is that the box pops up at a seamingly random location, sometimes outside the window and thus not visible. I would like the box to open near the
mouse-pointer.
These are the scripts involved:
Code:
<!-- Begin
function setupDescriptions()
{
var x = navigator.appVersion;
y = x.substring(0,4);
if (y>=4) setVariables();
}
var x,y,a,b;
function setVariables()
{
h=".pixelLeft=";
v=".pixelTop=";
dS="";
sD=".style";
}
function popLayer(a)
{
desc = "<table cellpadding=0 border=1 ";
if (a==0)
{
desc +=
"bgcolor=A7A7FF> <td> ... Message 1 ...";
}
if (a==1)
{
desc +=
"bgcolor=A7A7FF> <td> Message 2.";
}
<!-- etcetera
if (a==2)
{
desc +=
"bgcolor=A7FFA7> <td> message 3. ";
}
...
-->
desc += "</td></table>";
object1.innerHTML=desc;
eval(dS+"object1"+sD+h+(x+25));
eval(dS+"object1"+sD+v+y);
}
function hideLayer(a)
{
object1.innerHTML="";
}
function handlerMM(e)
{
x = event.clientX;
y = event.clientY;
}
document.onmousemove = handlerMM;
// End -->
</script>
<!-- INVOCATION IN THE body IS AS FOLLOWS:
onMouseOver="popLayer(1)" onMouseOut="hideLayer(-50)"
. . . IN OTHER PARTS popLayer(1) IS REPLACED BY
popLayer(2) ETC.
-->
Thanks !