By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,914 Members | 1,706 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,914 IT Pros & Developers. It's quick & easy.

Tool Tip / Pop up text box

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.