PDA

View Full Version : Cool DHTML Tooltip - external JS file possible?



nevdev
11-30-2006, 02:42 PM
1) Script Title: Cool DHTML Tooltip

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex5/dhtmltooltip.htm

3) Describe problem: Not really a problem - I just wanted to ask if it might be possible for the main js functions to reside in an external javascript file, instead of having to go in the page that shows the tooltip. (I tried to do this, but it doesn't appear to work as things are.)

Many thanks.

ddadmin
11-30-2006, 11:11 PM
The only issue I see preventing the script from going into an external file is the line:

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

Just delete that line, and have the script dynamically write it out, by adding this line to the start of the script:


<script type="text/javascript">

/***********************************************
* Cool DHTML tooltip script- &#169; 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
***********************************************/

document.write('<div id="dhtmltooltip"></div>')

var offsetxpoint=-60 //Customize x offset of tooltip
var offsetypoint=20 //Customize y offset of tooltip
"
"

Then save the resulting script as an external .js file.

nevdev
11-30-2006, 11:49 PM
hey - that seems to work perfectly - many thanks !

nevdev
11-30-2006, 11:56 PM
whoops! spoke too soon - doesn't appear to work like that in IE6/WinXp.. :mad:

..or in FF/WinXP..

ddadmin
12-01-2006, 01:03 PM
Ok I'm lazy so I haven't actually tested the above out, but I don't see any reason why it wouldn't work. Do you happen to have a link to the problem page?