Results 1 to 5 of 5

Thread: Dynamic Image Selector without the selection box?

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

    Default Dynamic Image Selector without the selection box?

    Script: Dynamic Image Selector

    http://www.dynamicdrive.com/dynamici...geselector.htm

    I've been using this script for a while, and while it has been very useful I would rather simply embed the choices as links in text (think tooltips) than use the selection box approach. However, with tooltips it doesn't seem possible for a tooltip-activated image to persist once you've clicked on another link.

  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

    Quote Originally Posted by aharvey
    However, with tooltips it doesn't seem possible for a tooltip-activated image to persist once you've clicked on another link.
    What's the difference? With Dynamic image selector, once you click on another selection, the previous image doesn't persist either.
    - John
    ________________________

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

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

    Default

    Quote Originally Posted by jscheuer1
    What's the difference? With Dynamic image selector, once you click on another selection, the previous image doesn't persist either.
    There's a big difference, at least I think there is! With the Dynamic image selector, there can be lots of other links on the page, and clicking or "mouseovering"(?) them does not affect the selected image. With the tooltip, the image disappears when the next link is activated.

    I'd like to be able to call up one image, say of an entire plant, on a page that describes the plant. The description may have some technical terms with which I (the user) may not be familiar, so I'd like to be have these also be links to illustrated definitions of terms that I can look at while also looking at my original image. Again, I make this work with one set of selections and one set of tooltips, but inline links would be cleaner in this case than the selection box.

  4. #4
    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

    OK, I misunderstood. Of course you can use a link to do what a select box option does, the syntax is just a little different:
    HTML Code:
    <a href="http://images.amazon.com/images/P/1565924940.01.TZZZZZZZ.jpg" onclick="generateimage(this.href, 0);return false;">DHTML Guide</a>
    The 0 in (this.href, 0) is the number for the description. Also you need to alter the script slightly, where it says:
    Code:
    function generateimage(which){
    Make it say:
    Code:
    function generateimage(which, num){
    and where it has:
    Code:
    contentobj.innerHTML='<center><img src="'+which+'"><br><br>'+description[tempobj.options.selectedIndex]+'</center>'
    Make it like this:
    Code:
    contentobj.innerHTML='<center><img src="'+which+'"><br><br>'+description[num]+'</center>'
    - John
    ________________________

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

  5. #5
    Join Date
    Jul 2005
    Posts
    16
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    John,

    Thank you! That works like a charm. Now I can have the best of both worlds (i.e, "static" images and dynamic tooltips) on the same page.

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
  •