Tool Tip / Pop up text box

V

Vandana Rola

Hello Everyone,

We are using javascript's tooltip (pop up on mouse over )function. The
problem we are having is as we go scroll two or three pages deep in to
the html page our tool tip /pop up gets farther away from the position
where it is supposed to be. It happens to the extend that at certain
point we don't see the tool tip at all.

Is there a way to fix the position of the tool tip /pop up, so that no
matter how deep we are in the page the tool tip is always close to the
link or mouse over text. We are using an external javascript and style
sheet file. Here is the code we are using:

Code for the javascript file:

function toolTips(evt,currElem,left) {
// Creates the tool tip for Internet Explorer
if ((navigator.appName == "Microsoft Internet Explorer") &&
(parseInt(navigator.appVersion) >= 4)) {
tipWin = eval("document.all." + currElem + ".style");
// Number at end of next line indicates the number of pixels from the
bottom of the cursor the tip is
tipWin.top = parseInt(evt.y)+document.body.scrollTop+10;
// Number at end of next line indicates the number of pixels to the
left of the cursor the tip is
tipWin.left = Math.max(2,parseInt(evt.x)+document.body.scrollLeft+left);
tipWin.visibility = "visible";
tipWin.status = "";
}

// Creates the tool tip for Netscape
if ((navigator.appName == "Netscape") &&
(parseInt(navigator.appVersion) >= 4)) {
tipWin = eval("document." + currElem);
// Number at end of next line indicates the number of pixels from the
bottom of the cursor the tip is
tipWin.top = parseInt(evt.pageY)+2;
// Number at end of next line indicates the number of pixels to the
left of the cursor the tip is
tipWin.left = Math.max(2,parseInt(evt.pageX)+ left);
tipWin.visibility = "visible";
tipWin.status = "";
}
}

function tipDown(currElem) {
// Closes the tool tip for Internet Explorer
if ((navigator.appName == "Microsoft Internet Explorer") &&
(parseInt(navigator.appVersion) >= 4)) {
tipWin = eval("document.all." + currElem + ".style");
tipWin.visibility = "hidden";
}
// Closes the tool tip for Netscape
if ((navigator.appName == "Netscape") &&
(parseInt(navigator.appVersion) >= 4)) {
tipWin = eval("document." + currElem);
tipWin.visibility = "hidden";
}
}


Code in the Style Sheet file:
#tipWin1,#tipWin2
{position:absolute;
visibility:hidden;}

..tipWinStyle {background-color:#FFFFDD;
layer-background-color:#FFFFDD;
border-color:#000000;
border-width:1px;
border-style:solid;
font-family:arial, helvetica, sans-serif;
font-size:9pt;
padding-left:2px;
padding-right:2px;}

H5.tipWinStyle
{

border-width:0px;
color: #800000;
font-weight: bold;
background-color : transparent;
 
V

Vladdy

Vandana said:
Hello Everyone,

We are using javascript's tooltip (pop up on mouse over )function. The
problem we are having is as we go scroll two or three pages deep in to
the html page our tool tip /pop up gets farther away from the position
where it is supposed to be. It happens to the extend that at certain
point we don't see the tool tip at all.

Is there a way to fix the position of the tool tip /pop up, so that no
matter how deep we are in the page the tool tip is always close to the
link or mouse over text. We are using an external javascript and style
sheet file. Here is the code we are using:

<snip />
I can only suggest using better code:
http://www.klproductions.com/kltooltips.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top