September 20th, 2003, 12:25 PM
could you help me to find the way to show term definitions over tooltips?
Dear PHP friends!
I was looking for a little tooltip PHP based script for giving some good definitions on my website and finally I couldn't manage to get anything really nice. Then, I saw the tooltips shown on the articles offered by this site (see an example here: http://www.devshed.com/Server_Side/J...ng2/page1.html) and it's really cute. You know, some kind of mouseover code to get a popup and there the term definition in a PHP page.
Could any of you point me to a similar solution (or this one implemented by site webmaster) to get this kind of tooltips working? I have been looking the overLIB doc for example but it's not under the way I am. It's managing link by link, getting in the code the definition and I would like to use something based on a external database, or in a configuration file, or plain text file or something where I could change for all the site at the same time. I don't know how is workin at devshed but it seems the script parse all the html output on the page to put the links and tooltips code at the end of the process. Maybe that's the way to proceed with some kind of parse script that search and replace?
Could you help me to find something similar? Thank you very very much! :-)
PS. I browsed old topics and posts for a couple of hours and I didn't find this information. I found some complaints about the script putting toltips in user names at this forum but no way to setup or get this great feature. Thank you again!
September 20th, 2003, 02:50 PM
September 21st, 2003, 05:30 AM
No man, any script coold be great :-) Let me know what are you thinking about, please!
Thank you very much for your help!
September 21st, 2003, 06:48 AM
this any good?
if (thetitle.length > 1)
for (i=0; i<thetitle.length; i++)
thetitles += thetitle[i] + "\r\n"
current.title = thetitles
else current.title = text
else if (document.layers)
'<layer bgColor="#FFFFE7" style="border:1px ' +
'solid black; font-size:12px;color:#000000;">' + text + '</layer>')
--LINKS IN THE PAGE--
<a onmouseover="showtip(this,event,'MY TIP HERE')" onmouseout="hidetip()" href="#">link</a>
September 21st, 2003, 02:41 PM
Thank you ralphuk100 for your hint, but if I'm not wrong I would add the tips in every term I want to define. Iwas looking for some kind of automated function, so I can define before all the terms and then the script will detect the terms into the text and add the tooltips (parsing the code or something similar).
I saw this function in a CMS but I don't want to use it. Only some hints to parse the code and put there the tooltips. Maybe put all the definitions in the header and make some kind of replacement to put the term, its definition and the tooltip code when it's needed? No idea at all :-)
Thank you for any input here!
September 21st, 2003, 02:59 PM
well this is effectively what the script I gave you does. Except that instead of defining all the tips at the top of the page you are defining them within the onMouseOver. Whats the difference? Its the same thing except your way you would have the tips at the top, and then each bit you wanted a tip on would have to have the onmouseover calling that tip anyway. Im not sure what you mean.
September 21st, 2003, 04:41 PM
Sorry, maybe I didn't explain it well :-) I was meaning that this method makes me to insert every defintion every time, and if I want to change it I have to go thru the code and edit. That's the way overLIB also works if I understand what you kindly proposed me.
What I would like to see is something to separate definitions from mouseover code, so I can add more terms to the script or change them and I always see the update version. I was considering a way that uses the header because I could use a include or something similar under PHP and get into all the pages all the code and proper definitions on the fly. I was only sugesting in case any of you know how to get it running.
Thank you for your time and let's see if I explained it better :-)
September 21st, 2003, 05:55 PM
just make an array in the header of all your definitions and then instead of putting the definition in the onMouseOver just put a call to the right array item?
September 22nd, 2003, 07:03 AM
well, it seems you got it, but could you please point me to an example to have a look? The essential idea would be to allow the script to detect terms into the text and add the code to show the defintions. I'm not a deep PHP developer and it's a bit difficult for me to get an idea about how go for that
Also, I don't know what was marron79 thinkinbg about. Are you near to ralphuk100 idea?
Thank you very much!
September 22nd, 2003, 07:05 AM
aah... you mean like if a page contains the phrase "php" or "help" then it becomes highlighted and when the mouse goes over it shows a tip?
September 22nd, 2003, 01:11 PM
September 22nd, 2003, 01:48 PM
Moved to Scripts forum from PHP board.
September 22nd, 2003, 02:58 PM
thank you drgroove, and excuse me for posting in the wring forum but i thought the idea would come over php development. And, excuse me, do you know anything about the script used on the docs i'm linking as examples here at devshed?
Ayway, any one here have any hint for what I'm trying to do? Thank you again in advance!
January 4th, 2004, 03:37 PM
I was wondering if there is any way at all to have the script reference an include script or a db of some type that has all the terms to look for and upon finding them, apply the tool tip (i'm doing this for definitions on a medical site, so to go through and do every definition would be BEYOND time consuming).
Any help you can offer would be GREATLY appreciated!