Creating a tooltip that updates everytime the mouse moves?
I have created a function for my table which works when a user mouses over the cell, the function gets the X position of the cursor and then keeps updating it, See below:
Copy code
- <table>
- <tr id="mon_Section">
<td id="day_Title">Monday</td>
<td id="mon_Row" onmousemove="movedamouse(event)"></td>
</tr>
</table>
Below is the javascript function:
Copy code
- <script type="text/javascript">
var mon_Pos;
function movedamouse (event)
{
mon_Pos = document.getElementById ("mon_Row");
myxpos = event.pageX;
myxpos = myxpos-112;
mytext = document.createTextNode (myxpos);
while (mon_Row.firstChild)
mon_Row.removeChild (mon_Row.firstChild);
mon_Row.appendChild (mytext);
}
</script>
How would i go about creating a Tooltip that displays the Xpos value and make it so that it updates automatically to show the new value once the cursor is moved?