Results 1 to 5 of 5

Thread: Can an image be added to this tooltip script?

  1. #1
    Join Date
    Feb 2006
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Can an image be added to this tooltip script?

    1) Script Title:
    Fixed Tooltip script

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...xedtooltip.htm

    3) Describe problem:
    Is is possible to insert an image into the tooltips?
    I know you have a script that does allow for images, but it interfers with my other scripts. I like the simplicity of this script, but I would like to add images. Thank you for you assistance.

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

    Default

    Yes. The best way is to declare it as a variable in the script though:

    Code:
    var tip1='Hey, look at this Image:<br><img src="some.jpg"><br>Isn\'t it neat?'
    This can go right before the </script> tag. You can use as many as you want, tip1, tip2, tip3, etc.

    Then in your trigger code:

    Code:
    <a href="some.htm" onMouseover="fixedtooltip(tip1, this, event, '150px')" onMouseout="delayhidetip()">Link Text</a>
    - John
    ________________________

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

  3. #3
    Join Date
    Feb 2006
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thanks!

    Thanks John. Works great!! Appreciate all your assistance and scripts.

  4. #4
    Join Date
    Feb 2006
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Another ??? Can a clickable link be added to the tooltip?

    Is it possible to add a clickable link inside this tooltip script? Thank you.

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

    Default

    Well, of course, you can add a link anywhere you like to the variable for the tip, ex:

    Code:
    var tip1='Hey, look at this <a href="some.htm">Image</a>:<br><img src="some.jpg"><br>Isn\'t it neat?'
    But, as soon as you try to move your mouse over the tip to use the link, it will very shortly thereafter disappear. To stop that from happening, alter this part of the code (add the red parts):

    Code:
    if (ie4||ns6)
    document.write('<div id="fixedtipdiv" onmouseover="clearhidetip();" onmouseout="delayhidetip();" style="visibility:hidden;width:'+tipwidth+';background-color:'+tipbgcolor+'" ></div>')
    - John
    ________________________

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

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
  •