Back To Start Of Archive
Taken From The Forum: Archived Topics for the old Version 3.0 JavaScript Menu
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:33
To Kevin: Problem with tooltips
Poster: Martin
Dated: Thursday March 20 2003 - 1:59:49 GMT
Hi Kevin,
I used 'popup textboxes' as described in the examples.
I have four anchor tags, every with a tooltip. Sometimes, the tooltip will not disapear, even if the mouse pointer ist somewhere else. If a tooltip overlaps an other one (tooltip1 waits to get closed and tooltip2 is already visible) a funny behaviour happens.
Checkout the printscreen.
Poster: kevin3442
Dated: Wednesday March 26 2003 - 18:09:50 GMT
Hi Martin,
Sorry it's taken me so long to get back to you. My work sometimes takes me into places or situations where I don't have much contact with the rest of the world! That's been the case for the past few weeks.
I hadn't forseen the situation you have here (clearly!). If you're still using those popup functions, let me know and I'll have a go at a solution for you. Probably won't be able to get to it until early next week however.
Kevin
ToolTips
Poster: Martin
Dated: Thursday March 27 2003 - 11:49:29 GMT
Hi Kevin,
Yes, i would to use your popups in several projects. It's a cool function. At the moment, we're using a different code for the popups, but we like to use your code to get rid of third party code. To see the old tooltips, please visit the site http://www.brainware.ch
If you have updated code, please keep me posted.
Thanks,
Martin
Poster: Martin
Dated: Thursday April 17 2003 - 0:11:03 BST
Hey Kevin, still somewhere in a dark office?
Do you have any idea, if your code will be fixed?
Thanks
Poster: kevin3442
Dated: Friday April 18 2003 - 1:31:07 BST
Hi Martin,
I'm really sorry man. I completely forgot about this until I got the notification in my inbox of your post to this thread. Work's been pretty busy lately, so I haven't been participating very much in these forums recently and your issue just sort of slipped my feeble mind. Again... sorry.
OK, enough with excuses. I've pretty much got it licked. Rather than trying to tweak the existing code to get past your problem, I wrote a couple of new functions specifically for textboxes. I have a little fine tuning to do, and the documentation to add. Should be ready tomorrow evening. I'll post again in this thread when it's ready.
A qestion for you: Do you use any of the other menu positioning functions for actual menus, or are you only interested in the popup textboxes? I could break out the textbox stuff into a separate file, to cut down on the overhead.
Kevin
Poster: Martin
Dated: Friday April 18 2003 - 15:23:25 BST
Hi Kevin,
In two projects, we only use the popup menus. If you can break out the textbox code into a separate files, do it! That might decrease the download time a bit. Sounds good!
cheers
Martin
Poster: kevin3442
Dated: Friday April 18 2003 - 23:28:50 BST
Hi Martin,
You can download an updated kc_positionedMenus.zip.
The zip contains a new file called kc_textBox.js, which contains the textbox functions: kc_openTextBox() and kc_closeTextBox(). This file requires that kc_commonFunctions.js also be loaded. The index.html file that comes with the zip documents the use of these new functions and shows a couple of examples.
The textboxes are meant to act like standard tooltips, appearing on mouseover and disappearing on mouseout. You can specify an optional delay between mouseover and the appearance of the textbox, so that the textbox won't pop up immediately (like a tooltip). If you close the box with a mouseout event, as intended, then there should be no possiility that two textboxes will overlap, since only one should be visible at any given time.
Hope that works for you. Let me know how it turns out.
Kevin
Poster: Martin
Dated: Saturday April 19 2003 - 0:38:41 BST
Hi Kevin,
Thanks a lot, you saved my day. I will test the code saturday.
cheers
Martin
Poster: kevin3442
Dated: Saturday April 19 2003 - 1:21:33 BST
Hi Martin,
I was playing around some more (it's Friday after all) and thought it would be fun to try my hand at some anticollision code, to prevent a menu (or textbox) from opening where part of it gets clipped by a window edge. So far I've had success bumping a menu to the left to prevent the right side from getting clipped, or up to prevent the bottom from getting clipped. I started with those since most tooltips open below and to the right of the cursor. It's working pretty well so far, so if clipping is an issue for you, let me know.
Well, the beer's almost gone and I don't have any bugs, so I'm headed home. Have a good weekend.
Kevin
Poster: Martin
Dated: Friday April 25 2003 - 9:44:51 BST
Hi Kevin,
My tooltips are working very well. You're code runs smoothly.
I will update the page into production in the evening (CET), checkout http://www.brainware.ch
Poster: kevin3442
Dated: Saturday April 26 2003 - 5:45:31 BST
Hi Martin,
Glad it works. Two things:
(1) I noticed that your tooltips have what appear to be links in them. Since the tootips now close onmouseout, the user won't be able to get to a link in the tooltip. Is that a problem?
(2) Have you tried opening the tooltips using the delay option?
Nice looking page design.
Kevin
Poster: Martin
Dated: Saturday April 26 2003 - 11:26:09 BST
Hi Kevin,
I did not update the site yet. The tooltips on the production server is made with some older code.
Actually, I'm bulding an "send to friend"-Feature with you code. It' looks pretty cool.
I will do the update today in the evening (hopefully...)
To your questions:
1: No 2: Yes
Thanks!
Poster: Martin
Dated: Thursday May 8 2003 - 22:02:48 BST
Hi Kevin,
I build a nice "Send to" Box with your code. Check this out:
http://www.brainware.ch/index.cfm?227D609919F844589879F0F03BE733F2
I used kc_openAboveThisObject and it works fine. Now we like to place the box with fixed coordinates instead of above the link.
I can't use the function kc_openAtPosition, the behaviour is not the same.
Any idea?
Poster: Martin
Dated: Thursday May 8 2003 - 22:04:41 BST
ooops, forgot something: Click on "send page" to see the popup
Poster: kevin3442
Dated: Friday May 9 2003 - 8:59:20 BST
Hi Martin,
I'm not 100% sure how you're calling kc_openAtPosition(), but given your use of kc_openAboveThisObject() on the test page, I'm guessing that you pass a 0 in the optional fourth parameter (the timeout), to keep the box open until manually closed. You're probably seeing that the box closes when you mouse out, instead of waiting for user input. Is that it?
I believe I know what caused this and how to fix it. Simply put, the cause was me... I screwed up a line in kc_openAtPosition(). Fortunately, the fix is me-based as well ... here it is:
Change line 103 of kc_positionedMenus.js from:
Code:
kc_showMenu(menuName);
To:
Code:
kc_showMenu(menuName, 1);
I can't believe my code editor didn't know that I meant to put that 1 in there! Seems like it's always leaving important stuff out, misspelling things, etc.
BTW, if you want to position the box absolutely because you want to avoid the possibility of it get clipped by the right edge of the browser window, you could check out the new version with built-in collision avoidance; it would automatically bump the box over to avoid getting clipped. I haven't uploaded this version, but if you're interested in trying it, I can get it to you.
Hope that helps... let me know.
Kevin
Poster: Martin
Dated: Friday May 9 2003 - 10:15:23 BST
Hi Kevin,
Please send me the new version, I will try it!