Results 1 to 2 of 2

Thread: How to change images that pop up in tooltips?

  1. #1
    Join Date
    Mar 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to change images that pop up in tooltips?

    1) Script Title: Image w/ description tooltip v2.0

    2) Script URL (on DD): Script: DD Tab Menu
    http://www.dynamicdrive.com/dynamici...dimgtooltip.js

    3) Describe problem:


    The sample initialization assumes that you will define values in an array called tooltips, within the tiparray function, only once, when the script is first called.

    In my application, I have a list of images. When the user selects an item in the list, six versions of the image appear in a table of thumbnail images for a preview of cropping and text placement done by the application. I want to use this script to pop up a window of these six images.

    No matter what I have tried, I am unable to change the items that pop up when the user selects a second or third image from the main list. The thumbnails change, but hovering always pops up the full-size image that first was loaded into tool.

    The intended target looks like this (with the src filled in my script):

    <a href="#" rel="imgtip[1]"><img id="preview_1" src=""/></a>

    I noticed that the init function at the bottom of the script creates code to be called by jquery when the document is loaded. I tried duplicating this, without the call to jquery(document).ready, in a function called

    refreshToolTips: function(targetselector) {
    var tiparray=ddimgtooltip.tiparray
    var $targets=$(targetselector)
    if ($targets.length==0)
    return
    ...
    }

    In my code that runs when the user selects an image from the list, I tried this (hard-coding the tiparray value just as a test):

    ddimgtooltip.tiparray[1] = 'images/renditions/bag_1.jpg';
    ddimgtooltip.refreshToolTips("*[rel^=imgtip]");

    This did not help. The $targets array was empty, so the function just returned. I might have other problems, too, but I believe I have correctly set the value of ddimgtooltip.tiparray[<my_index>].

    I understand regular expressions very well, but I don't know jQuery and don't understand that target selector syntax. What am I missing?

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

    Default

    I have a general sense of what you might be trying to do, but it'll be much clearer if you can post a link to the page in question containing what you have so far.
    DD Admin

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
  •