Results 1 to 2 of 2

Thread: Custom image for Image ToolTip

  1. #1
    Join Date
    Dec 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Custom image for Image ToolTip

    1) Script Title: Image w/ description tooltip

    2) Script URL (on DD): ImageToolTip

    3) Describe problem: I'd like a custom image to be show directly from the image src. im new to this and its a problem for me that ive been strugling with for 2 days now.

    i think im right when i guess the code at the HTML page should look like:
    Code:
    <img src="ima/prodPics/signDodge.jpg" alt="Dodge" onmouseover="doTooltip(event,'ima/prodPics/2_signDodge.jpg')" onmouseout="hideTip()">
    But its to much for me to solve atm.

    Why i want this done is because i have alot of images and it would just make the script slow and the old version i have messes up in IE. (DOM problem i think)

    Thanks for any help

  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

    The tooltips, including their images are configured here (from Step 1):

    Code:
    // tooltip content goes here (image, description, optional bgColor, optional textcolor)
    var messages = new Array();
    // multi-dimensional arrays containing: 
    // image and text for tooltip
    // optional: bgColor and color to be sent to tooltip
    messages[0] = new Array('red_balloon.gif','Here is a red balloon on a white background',"#FFFFFF");
    messages[1] = new Array('duck2.gif','Here is a duck on a light blue background.',"#DDECFF");
    messages[2] = new Array('test.gif','Test description','black','white');
    The part that goes in where the code from your post is should look like so:

    HTML Code:
    <img src="ima/prodPics/signDodge.jpg" alt="Dodge" onmouseover="doTooltip(event,0)" onmouseout="hideTip()">
    The 0 refers to the tip (messages number) to use. You can include the path for the image, ex:

    Code:
    messages[0] = new Array('ima/prodPics/2_signDodge.jpg','Dodge Sign',"#FFFFFF");
    If no text is desired:

    Code:
    messages[0] = new Array('ima/prodPics/2_signDodge.jpg','',"#FFFFFF");
    you still need an empty field for it (red in the above).
    - 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
  •