/    Sign up×
Community /Pin to ProfileBookmark

Scroll Bar Problem

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.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@wsupdpauthorJul 27.2006 — okay I got it to work by putting all the javascript in an outside file "calendar.js" and just calling it in the <head>. But now when I hover over a date the pop-up displays in the right position but kind of flickers as I move a little bit over each link. Anyone know any ideas to get rid of the flicking?
×

Success!

Help @wsupdp spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...