Lmillard
asked on
Javascript get mouse position
Hi,
I am collecting the mouse position on screen using javascript so that I can position a popup box next to the correct text. This is working fine in chrome and explorer but when I use the same script in mozilla the menu just appears in the top left corner of the screen.
I am only using the following simple code with offset being a value passed to the function which is normally the width of the box so that it positions correctly.
I am a total javascript novice so this could be completly wrong, any help is appreciated.
Cheers
Leigh
I am collecting the mouse position on screen using javascript so that I can position a popup box next to the correct text. This is working fine in chrome and explorer but when I use the same script in mozilla the menu just appears in the top left corner of the screen.
I am only using the following simple code with offset being a value passed to the function which is normally the width of the box so that it positions correctly.
I am a total javascript novice so this could be completly wrong, any help is appreciated.
Cheers
Leigh
function showTypemenu(Typeid,taskid,offset) {
$('#menubox').load(httppath+'taskmanager/GetTaskType.cfm?Typeid='+escape(Typeid)+'&taskid='+escape(taskid))
document.getElementById('menubox').style.visibility = 'visible';
document.getElementById('menubox').style.height = 'auto';
document.getElementById('menubox').style.left = (window.event.clientX - offset) + 'px';
document.getElementById('menubox').style.top = (window.event.clientY + 15) + 'px';
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.