D
DJ WIce
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.style;
zoom_factor = (how)?100:110;
zoomed = bodyStyle.zoom;
if ((zoomed)&&(zoom_factor!=100))
zoom_factor=parseInt(zoomed)*parseInt(zoom_factor)/100;
bodyStyle.setAttribute('zoom', parseInt(zoom_factor)+'%');
}
I also have a function to locate the mouse cursor:
var x, y;
function TraceMouse(e)
{
x = (document.all) ? document.body.scrollLeft + event.clientX : e.pageX;
y = (document.all) ? document.body.scrollTop + event.clientY : e.pageY;
flag = 1;
}
if (!document.all)
document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = 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):
http://www.djwice.com/contextmenu.html
The script:
http://www.djwice.com/contextmenu/contextmenu.js
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.style;
zoom_factor = (how)?100:110;
zoomed = bodyStyle.zoom;
if ((zoomed)&&(zoom_factor!=100))
zoom_factor=parseInt(zoomed)*parseInt(zoom_factor)/100;
bodyStyle.setAttribute('zoom', parseInt(zoom_factor)+'%');
}
I also have a function to locate the mouse cursor:
var x, y;
function TraceMouse(e)
{
x = (document.all) ? document.body.scrollLeft + event.clientX : e.pageX;
y = (document.all) ? document.body.scrollTop + event.clientY : e.pageY;
flag = 1;
}
if (!document.all)
document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = 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):
http://www.djwice.com/contextmenu.html
The script:
http://www.djwice.com/contextmenu/contextmenu.js
If anyone has ideas why it goes wrong, please let me know.
Thanks,
Wouter