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;
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;