I designed a calendar for a website. For certain dates, when you hover over the date a pop up displayes giving you some information. Now when their is no scroll bar on teh right hand side (all the info fits) there is no probelm wit the pop up. It displays right above the date when you hover over it and hides when your not over the date. When you view the page smaller (not maximized) and there is a scroll bar on the right there is a problem only when the scroll bar is not at the top. If you scroll down the page a little bit. Then highlight one of the dates the pop up displays about an inch high then it was suppose to. Then when you scroll down even further and hover over a date, the pop up displays even higher than before. Anyone got any ideas how to fix this so no matter when the scroll bar is the pop always displays in the same position. Here is the code I am using to display the pop up.
function Show1()
/* Get the Mouss Position
{
var x = 0;
var y = 0;
if (!e) var e = window.event;
if (e.pageX || e.pageY)
{
x = e.pageX;
y = e.pageY;
}
else if (e.clientX || e.clientY)
{
x = e.clientX + document.body.scrollLeft;
y = e.clientY + document.body.scrollTop;
}
/* display the pop-up
Popup1.style.display=”block”;
Popup1.style.position=”absolute”;
/* set the pop-up’s left
Popup1.style.left = x – 2;
/* set the pop-up’s top
Popup1.style.top = y – 48;
}
The “x – 2” and “y – 48” put the pop exactly where I want it while the scroll bar is at the top or when the page is maximized.