Hi,
I have a function on my page to zoom in (for people who have not very good
eyes for example):
var zoom_factor=100 ;
function zoom(how)
{
var bodyStyle = document.body.s tyle;
zoom_factor = (how)?100:110;
zoomed = bodyStyle.zoom;
if ((zoomed)&&(zoo m_factor!=100))
zoom_factor=par seInt(zoomed)*p arseInt(zoom_fa ctor)/100;
bodyStyle.setAt tribute('zoom', parseInt(zoom_f actor)+'%');
}
I also have a function to locate the mouse cursor:
var x, y;
function TraceMouse(e)
{
x = (document.all) ? document.body.s crollLeft + event.clientX : e.pageX;
y = (document.all) ? document.body.s crollTop + event.clientY : e.pageY;
flag = 1;
}
if (!document.all)
document.captur eEvents(Event.M OUSEMOVE);
document.onmous emove = TraceMouse;
Now I want to write some menu on the place where the mouse is oncontextmenu.
But when the page is zoomed in, the menu is placed more down than usual.
The page (just a page I make to test what is possible with javascript):
The script:
If anyone has ideas why it goes wrong, please let me know.
Thanks,
Wouter
I have a function on my page to zoom in (for people who have not very good
eyes for example):
var zoom_factor=100 ;
function zoom(how)
{
var bodyStyle = document.body.s tyle;
zoom_factor = (how)?100:110;
zoomed = bodyStyle.zoom;
if ((zoomed)&&(zoo m_factor!=100))
zoom_factor=par seInt(zoomed)*p arseInt(zoom_fa ctor)/100;
bodyStyle.setAt tribute('zoom', parseInt(zoom_f actor)+'%');
}
I also have a function to locate the mouse cursor:
var x, y;
function TraceMouse(e)
{
x = (document.all) ? document.body.s crollLeft + event.clientX : e.pageX;
y = (document.all) ? document.body.s crollTop + event.clientY : e.pageY;
flag = 1;
}
if (!document.all)
document.captur eEvents(Event.M OUSEMOVE);
document.onmous emove = TraceMouse;
Now I want to write some menu on the place where the mouse is oncontextmenu.
But when the page is zoomed in, the menu is placed more down than usual.
The page (just a page I make to test what is possible with javascript):
The script:
If anyone has ideas why it goes wrong, please let me know.
Thanks,
Wouter
Comment