WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 ToolTip Errors, Dave, October 23, 2000
     Re:ToolTip Errors, MikeDude, November 13, 2000
         Re:ToolTip Errors , baranka, April 2, 2001
         Re:ToolTip Errors, Dave, November 27, 2000
             Re:ToolTip Errors, Dan Richards, February 14, 2001

Subject: Re:ToolTip Errors From: Dan Richards Date: February 14, 2001

Hi

If you change the bits of the functions in tooltip.js to what's shown below in red, it fixes it:

function document.onmousemove() {
 x = window.event.x+document.body.scrollLeft;
 y = window.event.y+document.body.scrollTop;
}

function getDirection() {
 var pageWidth, pageHeight, scrollTop;
// if (ie) {
  pageHeight    = document.body.clientHeight;
  pageWidth     = document.body.clientWidth;
  toolTipTop    = internalTooltipSpan.style.pixelTop;
  toolTipLeft   = internalTooltipSpan.style.pixelLeft;
  toolTipHeight = internalTooltipSpan.offsetHeight;
  toolTipWidth  = internalTooltipSpan.offsetWidth;
  scrollTop     = document.body.scrollTop;
  scrollLeft    = document.body.scrollLeft;

  if (toolTipWidth > pageWidth)
   internalTooltipSpan.style.left = scrollLeft;
  else if (toolTipLeft + toolTipWidth > pageWidth)
   internalTooltipSpan.style.left = pageWidth - toolTipWidth;

  if (toolTipTop + toolTipHeight > pageHeight) {
   internalTooltipSpan.style.top = toolTipTop - toolTipHeight - 22;
   return 8;
  }
  return 2;
// }
}

Cheers

 

Dan

 

From: Dave
Sent: November 27, 2000
Subject: Re:ToolTip Errors

Thats a great solution.  I wish I wasnt brain dead sometimes! ahahhahaah

Thanks

Dave

From: MikeDude
Sent: November 12, 2000
Subject: Re:ToolTip Errors

You could do something like this:

Change event.clientX and event.clientY to

(event.clientX+document.body.scrollLeft) and (event.clientY+document.body.scrollTop)

I think that will solve your problem.

 

-Mike (a 12 year old)

From: Dave
Sent: October 22, 2000
Subject: Re:ToolTip Errors

I was testing out some of the examples to see how they work and ran into a problem I have run into before and havent been able to fix.

When you use the tooltips demo and scroll the screen down a little bit, then try to rollover somewhere where a tooltip should be, the tooltip is shown relative to the absolute position of the screen.  So the tooltip may not be visible because it is at the top of the screen.  I ran into this before when using , I think this was it, clientx and clienty. 

I was working on building a context menu when someone right clicked on something, but once they scrolled the screen, the positioning went hay wire.  Anyone know how to fix something like that?

thanks

Dave

 







Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX