I want to display div above image so that div's top is aligned with cursor.
As cursor is moved, the div should be moved as well (right now just vertically).
In IE (**pure javascript please**).
<head runat="server">
<title></title>
<style type="text/css">
#ToolTip{position:absolute; width: 200px;background-color:Lime; top: 0px; left: 0px; z-index:400;visibility:hidden;}
</style>
<script language="javascript" type="text/javascript">
function On() {
MoveToolTip("ToolTip", "event.y", "event.x");
document.getElementById('ToolTip').style.visibility = 'visible';
}
function Off() {
MoveToolTip("ToolTip", 0, 0);
document.getElementById('ToolTip').style.visibility = 'hidden';
}
function MoveToolTip(layerName, top, left) {
document.getElementById(layerName).style.top = (eval(top));
//document.getElementById(layerName).style.left = (eval(left) - 360);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<div id="ToolTip" >This is a test </div>
<a href="www.www.com"><img alt="mg" border="0" src="http://www.google.com/logos/holiday09_4.gif" onmouseout="Off();" onmouseover="On();" /></a>
</div>
</form>
</body>
</html>