Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DHTML baloon help? 1

Status
Not open for further replies.

Rydel

Programmer
Feb 5, 2001
376
CZ
I don't feel like re-inventing the wheel. Are there some ready-to-use DHTML scripts to show baloon help like those little "yellow balloons" that you get if you specify title attribute of an element (it's just I want something that can understand formatted text). Thanks a lot in advance! ---
---
 
jaredn,

1) that was precisely what i needed. thanks a lot! very nifty.
2) i am aware of the existence of javascript forum. it's just dhtml is still html, even if it is dynamic so i thought that it would be more appropriate to post it here.

starfishh,
i know about that site. unforutnately it has only simple stuff (or, whenever, it is not simple, it's usually not very useful :)). i used to go to that javascript.internet.com during my first month of studying javascript, but it's not useful for anything more advanced.

---
---
 
Just for the record, having spoken to the owner / staff on this forum, all DHTML questions should go into either the:

Javascript or
VBScript

forums. This forum is reseverved for static HTML and CSS. I know you didn't know, so don't worry about it. :)

Hope you enjoy WebFX. jared@eae.net -
 
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!

---
---
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top