Results 1 to 5 of 5

Thread: Cool DHTML Tooltip - external JS file possible?

  1. #1
    Join Date
    Jul 2005
    Posts
    39
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Question Cool DHTML Tooltip - external JS file possible?

    1) Script Title: Cool DHTML Tooltip

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...tmltooltip.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.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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:

    Code:
    <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.

  3. #3
    Join Date
    Jul 2005
    Posts
    39
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default works!

    hey - that seems to work perfectly - many thanks !

  4. #4
    Join Date
    Jul 2005
    Posts
    39
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Exclamation oh no it doesn't!

    whoops! spoke too soon - doesn't appear to work like that in IE6/WinXp..

    ..or in FF/WinXP..
    Last edited by nevdev; 12-01-2006 at 12:01 AM. Reason: addendum

  5. #5
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •