Jaredn,
I looked at the source code of both scripts (yours and that other one I mentioned in my previous post, overlib). Yours is definitely
much better. It does the job while being almost 10 (ten!) times smaller than the other script (4KB vs 37KB), and it is even more flexible (allowing for any html markup). Now there is only one little glitch I noticed (looking at it in IE5.0 and IE5.5). If you
scroll the page the location of the tooltip gets out of sync sometimes. It seems to stay more and more
up and away from the element as I scroll down. Did you have this kind of weird behavior?
I wonder what happens. I saw two possible cause of error. I think one possible scenario is that when I scroll by grabbing the scroll bar with the mouse, this function
Code:
function document.onmousemove() {
x = window.event.x;
y = window.event.y;
}
doesn't get called. Is scrollbar a part of the document, i.e. does onmousemove gets fired if you have your mouse moving over scrollbars? Similarly if I just press PageDown on the keyboard this funcrion never gets called and we get wrong coordinates. Right?
The other possibility is that you don't account for scrolling correctly in
getDirection() function. I got a bit lost there. Particularly, I don't understand this:
Code:
if (toolTipTop + toolTipHeight - scrollTop > pageHeight) {
internalTooltipSpan.style.top = toolTipTop - toolTipHeight - 22;
return 8;
Why -22? and why returning 8? I figured this dir value is used for swiping/fading functions, but I don't have those. I got a bit lost there. Do you think there could be something wrong there that prevents the tooltip getting the correct
y coordinate? Thanks a lot in advance!
P.S. I wonder if it depends on what code I have on the page. In case it does, please go to
page. You'll get to the links page which has your baloon tooltips. Thanks again!
---
---