469,903 Members | 1,661 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,903 developers. It's quick & easy.

Tool Tip / Pop up text box

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.scrollLef t+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;
Jul 23 '05 #1
1 3054
Vandana Rola wrote:
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

--
Vladdy
http://www.klproductions.com
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Paul Kooistra | last post: by
1 post views Thread by Donnie | last post: by
4 posts views Thread by Steven Ramacher | last post: by
2 posts views Thread by Zhang Weiwu | last post: by
5 posts views Thread by TonyJ | last post: by
7 posts views Thread by ab3331 | last post: by
4 posts views Thread by Anastasios Hatzis | last post: by
26 posts views Thread by webrod | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.