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,cu rrElem,left) {
// Creates the tool tip for Internet Explorer
if ((navigator.app Name == "Microsoft Internet Explorer") &&
(parseInt(navig ator.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,pars eInt(evt.x)+doc ument.body.scro llLeft+left);
tipWin.visibili ty = "visible";
tipWin.status = "";
}
// Creates the tool tip for Netscape
if ((navigator.app Name == "Netscape") &&
(parseInt(navig ator.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.pa geY)+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,pars eInt(evt.pageX) + left);
tipWin.visibili ty = "visible";
tipWin.status = "";
}
}
function tipDown(currEle m) {
// Closes the tool tip for Internet Explorer
if ((navigator.app Name == "Microsoft Internet Explorer") &&
(parseInt(navig ator.appVersion ) >= 4)) {
tipWin = eval("document. all." + currElem + ".style");
tipWin.visibili ty = "hidden";
}
// Closes the tool tip for Netscape
if ((navigator.app Name == "Netscape") &&
(parseInt(navig ator.appVersion ) >= 4)) {
tipWin = eval("document. " + currElem);
tipWin.visibili ty = "hidden";
}
}
Code in the Style Sheet file:
#tipWin1,#tipWi n2
{position:absol ute;
visibility:hidd en;}
..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;
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,cu rrElem,left) {
// Creates the tool tip for Internet Explorer
if ((navigator.app Name == "Microsoft Internet Explorer") &&
(parseInt(navig ator.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,pars eInt(evt.x)+doc ument.body.scro llLeft+left);
tipWin.visibili ty = "visible";
tipWin.status = "";
}
// Creates the tool tip for Netscape
if ((navigator.app Name == "Netscape") &&
(parseInt(navig ator.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.pa geY)+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,pars eInt(evt.pageX) + left);
tipWin.visibili ty = "visible";
tipWin.status = "";
}
}
function tipDown(currEle m) {
// Closes the tool tip for Internet Explorer
if ((navigator.app Name == "Microsoft Internet Explorer") &&
(parseInt(navig ator.appVersion ) >= 4)) {
tipWin = eval("document. all." + currElem + ".style");
tipWin.visibili ty = "hidden";
}
// Closes the tool tip for Netscape
if ((navigator.app Name == "Netscape") &&
(parseInt(navig ator.appVersion ) >= 4)) {
tipWin = eval("document. " + currElem);
tipWin.visibili ty = "hidden";
}
}
Code in the Style Sheet file:
#tipWin1,#tipWi n2
{position:absol ute;
visibility:hidd en;}
..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;
Comment