PDA

View Full Version : DHTML Text-hovering Tooltip



Shammus
02-12-2009, 06:30 PM
Hi all,

I had a question about a neat little script I found at the URL below.

http://www.dynamicdrive.com/dynamicindex5/dhtmltooltip.htm

Basically you hover over a link and a little window appears with text, images etc in it until you roll off the original link.

My question concerning this is, I'd like to place the javascript in an external .js file so it doesn't clutter up the html page. Yet when I copy the script over to a new .js page and then reference that .js file in the <head> portion of my html page, the script no longer works. Is there anything I'm missing?

Thanks in advance....

ddadmin
02-12-2009, 10:58 PM
Try the attached .js file. Then, in the BODY section of your page (outside any tags other than the BODY tag itself), you'd add the following:


<div id="dhtmltooltip"></div>

<script type="text/javascript" src="dhtmltooltip.js">

/***********************************************
* Cool DHTML tooltip script- Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>

That should do it. Note that you'll still have to insert the default CSS code (code of Step 1) onto your page.

Shammus
02-12-2009, 11:08 PM
That worked. Thanks a bunch for the response!

Basically I forgot to place the line that calls the .js file in the <body> portion. I kept placing it in the <head> which didn't work here.

Thanks again!