[Error: Irreparable invalid markup ('') in entry. Owner must fix manually. Raw contents below.]
I'm working on a site design using a good deal of DHTML and have run into a snag. I'm trying to detect where the user's mouse is, but I can't for the life of me get the correct position. I'm using the mouse detection script from quirksmode, but instead of giving me a position anywhere near the mouse (which in the case of what I was attempting to detect would of been somewhere in the neighbourhood of 100,350), but instead thinking my mouse is down outside of the page view somewhere around 560X. (Just in case it makes a difference, I have part of the page pulled in with a php require() ).
tooltip.js
function inittooltip(target) { tltp = new getObj(target); tltp.obj.onmouseover = showtooltip; tltp.obj.onmouseout = stoptooltip; }
function showtooltip(e) { var isOpera = (navigator.userAgent.indexOf('Opera') != -1); var isIE = (!isOpera && navigator.userAgent.indexOf('MSIE') != -1)
var posx = 0; var posy = 0; var targ;
if (!e) var e = window.event; if (e.pageX || e.pageY) { posx = e.pageX; posy = e.pageY; }else if (e.clientX || e.clientY) { posx = e.clientX; posy = e.clientY; if (isIE) { posx += document.body.scrollLeft; posy += document.body.scrollTop; } }
if (e.target) targ = e.target; else if (e.srcElement) targ = e.srcElement;
function getObjNN4(obj,name) { var x = obj.layers; var thereturn; for (var i=0;i { if (x[i].id == name) thereturn = x[i]; else if (x[i].layers.length) var tmp = getObjNN4(x[i],name); if (tmp) thereturn = tmp; } return thereturn; }