Are you looking for something like this?
Code:
<HTML><head>
<script type="text/javascript">
var IE = document.all?true:false
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;
var tempX = 0
var tempY = 0
// ===========================
function getMouseXY(e) {
if (IE) {
tempX = event.clientX + document.body.scrollLeft
tempY = event.clientY + document.body.scrollTop
} else {
tempX = e.pageX
tempY = e.pageY
}
if (tempX < 0){tempX = 0}
if (tempY < 0){tempY = 0}
document.getElementById('TestDiv').style.left=tempX;
document.getElementById('TestDiv').style.top=tempY;
return true;
}
// ===========================
function ShowIt() {
document.getElementById('TestDiv').style.display='block';
}
// ===========================
function HideIt() {
document.getElementById('TestDiv').style.display='none';
}
// ===========================
</script>
</head>
<input id="Button1" style="width: 100px; height: 100px" type="button" value="button" onmouseover="ShowIt();" onmouseout="HideIt();"/>
<div id="TestDiv" style="display:none; border:1px solid black;width:150px;height:100px;position:absolute;text-align:center;background-color:#FFFFF0;">
<br/>This is a sample message
</div>
</HTML>
==============================================================================================================
Disclaimer: The provider of this code offers no warranties or assurances of any kind. The code may or may not be 100% compliant with every single coding standard up to the current date, hour or minute. If you are a whiney, pretentious "code nazi" offended by the occasional use of deprecated tags, non-shorthand CSS, voluminous use of ASP.NET, or other preferences chosen by the provider, then bypass this post or leave the website completely - this is not for you.
==============================================================================================================
Bookmarks