Results 1 to 3 of 3

Thread: DHTML Text-hovering Tooltip

  1. #1
    Join Date
    Feb 2009
    Posts
    48
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default DHTML Text-hovering Tooltip

    Hi all,

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

    http://www.dynamicdrive.com/dynamici...tmltooltip.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....

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

    Default

    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:

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

  3. #3
    Join Date
    Feb 2009
    Posts
    48
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default DHTML Text-hovering Tooltip

    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!

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
  •