Results 1 to 3 of 3

Thread: Display function argument on different iframe

  1. #1
    Join Date
    Dec 2013

    Display function argument on different iframe

    ASP page with two iFrames -- one left side; one, right side
    Left side iFrame (id/name = thumbnailViewer)
    iFrame displays thumbnails of pictures with a caption immediately below the image (All thumbnails contained in a table.)
    Each thumbnail (including the caption) are hyperlinks (target = 'photoviewer')
    Clicking any of these links loads a corresponding larger size picture in the right iFrame

    Right side (id and name = 'photoviewer')
    On page load src for right iFrame is small black PNG against black background (= iFrame is 'empty')
    When left iFrame link is clicked, corresponding larger copy of thumbnail loaded and displayed

    What I want to do:
    I have search far and wide for some means to display the caption below the larger image in the right (photoviewer) iFrame.
    When website visitor licks a thumbnail (in 'thumbnailviewer' iFrame), I want the larger copy of the picture to be displayed in the 'photoviewer' iFrame. <== This works

    I want the thumbnailviewer caption to be displayed below the image in photoviewer.

    Is this possible and, if so, how can I do this. None of the javascript I've found, modified, or written accomplishes my goal.

    Thanks in advance for any guidance!!

  2. #2
    Join Date
    Dec 2013
    Please note: I even tried using a function 'argument' to convey the caption text to photoviewer. Hence, the title of this post. In retrospect, the title seems to be a poor choice.

  3. #3
    Join Date
    Dec 2013

    I found the solution.

    Here is what I was doing incorrectly:
    1. Trying to 'capture' the left-iFrame link click
    2. Assign ('remember') a variable associated with that click event
    3. Port that variable into a different iFrame
    4. Write the variable as a picture caption.

    Way too complicated... and unnecessary and probably not possible!

    When left-iFrame link clicked, that causes Parent page to reload (including both iFrames) -- thumbnail page on left (no changes) and now a different page containing only the corresponding large image <img id="imageview"....> on the right.

    Because the right-iFrame is loading, this script (located immediately below the image) runs.
    <s c r i p t>
    document.write(document.getElementById("imageview").alt); //* imageview is id of image tag
    </s c r i p t>

    Voila! Caption is now displayed!

    Thanks for the bandwidth...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center

Recent Articles