Results 1 to 4 of 4

Thread: Cool DHTML Tooltips script

  1. #1
    Join Date
    Jun 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Cool DHTML Tooltips script

    I am trying to use the listed script inside an image map but appear to be missing something. I am not trying to link to another site, I just want the tooltip to appear and list text about the portion of the image map they are hovering over. Anyone have any ideas on what the correct code would be for this? Here is a brief example of what I am doing.

    <MAP NAME ="descriptions">
    <AREA SHAPE="rect" COORDS = "0, 30, 77, 549" HREF= onMouseover="ddrivetip('All functions in Essentials can be accessed from seven primary screens. They are always visible and can be reached from anywhere in the software',)";
    onMouseout="hideddrivetip()"">

    <AREA SHAPE="rect" COORDS = "83, 39, 91, 101" HREF="onMouseover="ddrivetip(This is some more text.')";
    onMouseout="hideddrivetip()"">
    </map>

    Thanks in advance for any help.

    Scott Karren

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,496
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Image maps can give rise to hard to track down scripting problems even when the code is essentially correct or at least looks that way. I say this because once we clear up the obvious syntax problems, that is no guarantee things will work as expected. Add to that the fact that you may have other errors not shown in such an abbreviated code snippet . . .

    Well that was a long way to go but, I'm fairly sure you've got the idea. Now, on to those obvious syntax problems. An href cannot equal a mouseover, a semicolon (if needed or optional) should lie at the end of a javascript code segment (not outside of quotes signifying that what follows is not javascript code) and a comma shouldn't follow a parameter unless also followed by another parameter, so try:
    Code:
    <MAP NAME="descriptions">
    <AREA SHAPE="rect" COORDS="0, 30, 77, 549" HREF="#" onclick="return false;" onMouseover="ddrivetip('All functions in Essentials can be accessed from seven primary screens. They are always visible and can be reached from anywhere in the software')" onMouseout="hideddrivetip()">
    
    <AREA SHAPE="rect" COORDS="83, 39, 91, 101" HREF="#" onclick="return false;" onMouseover="ddrivetip('This is some more text.')" onMouseout="hideddrivetip()">
    </map>
    You were also missing a single quote at the beginning of "This is some more text" but, I figured that was just an honest typo (those will still break the code though). You can have COORDS = "0, 30, 77, 549" but the extra spaces around the equals sign are just that, extra. You do need spaces between attributes though. The attributes in the above are shape, coords, href, onclick, onmouseover, and onmouseout.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jun 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Cool DHTML Tooltips script

    I forgot to post this before. Thanks for the reply, your suggestions worked perfectly for me. Thanks again.

  4. #4
    Join Date
    Jun 2005
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    try to slice the image into chunk

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
  •