[code=php]function handlepopup(){
var solPopUp = document.getElementById(‘solPopUp’);
if(solutionshttp.readyState == 4){
addpopup(solPopUp, solutionshttp.responseText);
}
return;
}
function addpopup(solPopUp,text,horz,vert){
var mouseX = event.clientX+”px”;
var mouseY = event.clientY+”px”;
solPopUp.style.left = mouseX;
solPopUp.style.top = mouseY;
solPopUp.style.zindex = “15”;
solPopUp.innerHTML = text;
}
function topFive(queryline){
solutionshttp.open(‘get’, ‘solutionsquery.php?selectgroup=’+queryline);
solutionshttp.onreadystatechange = handlepopup;
solutionshttp.send(null);
}
What I’m trying to do is make a tiny popup appear (not a web browser type, but if you’ve seen Netflix and how they work you’ll understand). This pop up will have information obviously built from a php script and displayed dynamically like AJAX.
The problem is the event handler. I know I’m doing something wrong because there is more to event capturing than this. I need the pop up to appear right near the cursor at the time of a mouseover. I’ve been able to get an alert to show me the cursor position but I’ve not been able to get those same numbers to work in a CSS style change. I keep getting type mismatch errors and event is not defined and such.
Any ideas and help would be appreciated.
Jim