View Single Post
Old 04-18-2005   #13 (permalink)
The Eagle
Moderator
 
Join Date: Jul 2004
Location: Quebec City, Canada
Posts: 50

Code:
<script type="text/javascript">
/* <![CDATA[ */

var initialize = false;
var ContentInfo = '';
var ToolTip;
var pos = new Array(2);
pos[0] = 0;
pos[1] = 0;

var topColor = "#EFF2E0"
var subColor = "#FFFFFA"

function loadfunc() {

	ToolTip = document.getElementById("ToolTip");


}


function overhere(e){
	if(initialize) {
		if(e)
			MoveToolTip(e.pageX + 15, e.pageY);

		else
			MoveToolTip(window.event.x + 15, window.event.y);
	}
	else {
		if(e) {

			pos[0] = e.pageX;
			pos[1] = e.pageY;

		}

		else {

			pos[0] = window.event.x;
			pos[1] = window.event.y;

		}
	}
}

function Activate() {

	MoveToolTip(pos[0] + 15, pos[1]);
	ToolTip.style.visibility = "visible";
	initialize = true;

}

function deActivate() {
	
	ToolTip.style.visibility = "hidden";
	initialize = false;

}

function MoveToolTip(x, y) {

	ToolTip.style.left = x + 'px';
	ToolTip.style.top = y + 'px';

}

function ReplaceContent() {

	ToolTip.innerHTML = ContentInfo;

}

function EnterContent(layerName, TTitle, TContent){
ContentInfo = '<table border="0" width="250" cellspacing="0" cellpadding="0">'+
'<tr><td width="100%" bgcolor="#000000">'+
'<table border="0" width="100%" cellspacing="1" cellpadding="0">'+
'<tr><td width="100%" bgcolor='+topColor+'>'+
'<table border="0" width="100%" cellspacing="0" cellpadding="0" align="center">'+
'<tr><td width="100%">'+
'<font class="tooltiptitle">*'+TTitle+'</font>'+
'</td></tr>'+
'</table>'+
'</td></tr>'+
'<tr><td width="100%" bgcolor='+subColor+'>'+
'<table border="0" width="100%" cellpadding="0" cellspacing="1" align="center">'+
'<tr><td width="100%">'+
'<font class="tooltipcontent">'+TContent+'</font>'+
'</td></tr>'+
'</table>'+
'</td></tr>'+
'</table>'+
'</td></tr>'+
'</table>';
ReplaceContent();
}

/* ]]> */
</script>
Code:
onload="loadfunc(); window.onmousemove = overhere;" onmousemove="overhere();"
So far I got it to work with IE6, Firefox and Konqueror. The original script looks like it was written 10 years ago and uses outdated methods, which are (thankfully) not supported in Firefox and modern Gecko releases.
The Eagle is offline