Respuesta en inglés
Ah, I see the problem. You are using Microsoft's Document Object Model. This works in IE 4+, Opera and Konqeuror.
I have modified your code so that it should work in IE DOM friendly browsers and W3C DOM friendly browsers (such as Mozilla, Netscape and Epiphany).
In actual fact you need only use the W3C DOM as this will work in IE 5+, Opera and Konqueor etc anyway, but I've left the IE DOM in case you're catering for IE4 users.
Click anywhere on the page to get the pop up message, move the mouse to lose it.
I don't use Windows so have not tested it in IE but it does work using .all under Konqueror and using getElementById in a variety of browsers.
HTH
<html>
<head>
<title></title>
</head>
<body>
<script language="javascript" type="text/javascript">
document.write("<div id='tip' style='position:absolute;visibility:hidden;left:10 0;top:100'><table borderstyle=outset border=0 bgcolor=#00c00c bordercolor=#ffffff><td id=message><br></td></table></div>");
function tip(msg,myEvent)
{
// check for IE4+ DOM and W3C DOM
scope = document.all? document.all.message : document.getElementById("message");
scope.innerHTML="<font color=#FFFFFF size=2 face=arial>"+msg+"</font>";
// check for IE4+ DOM and W3C DOM
twnd= document.all? document.all.tip : document.getElementById("tip");
twnd.style.visibility="visible";
twnd.style.top=myEvent.clientY+19;
twnd.style.left=myEvent.clientX-2;
}
function hide(){
twnd= document.all? document.all.tip : document.getElementById("tip");
twnd.style.visibility="hidden";
}
</script>
<body onClick="tip('Hello',event)" onMouseMove="hide()">
</body>
</html>
pero funciona!!!!!!
|