Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: linking iframes

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

    Default linking iframes

    hi am having this problem, if anyone can help me figure it out i will be eternally grateful.
    I have two iframes on my page. One is scrollable, and the other isnt. What i want to do is to be able to link items on the scrollable iframe to the other iframe. Such that when you click on the thumbnail of the item on the scrollable iframe, it will pop up in the iframe beside it. How do i do this without using html?bluegasps@yahoo.com

  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

    What's wrong with HTML? Using it, you would have:

    HTML Code:
    <a href="filename.ext" target="iFrameName"><img src="thumbnail.ext"></a>
    Using javascript would not be much different:

    HTML Code:
    <a href="filename.ext" target="iFrameName" onclick="parent.iFrameName.location.replace(this.href);return false;"><img src="thumbnail.ext"></a>
    There are actually many syntaxes available to do this in javascript. This is the only one where the result would be any different than the plain HTML code. That difference would be that the history stack would remain unchanged using this javascript onclick event.
    - John
    ________________________

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

  3. #3
    Join Date
    Dec 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    am not really fond of html... so if there is another way of doing it that would really make my day.

  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

    If you do not use at least a bootstrap HTML with javascript, as in my second example, non-javascript enabled browsers or those with javascript enabled but with high security settings, will not see your content. Also, I think that you may have misunderstood, my second example, although written in an HTML code block and using bootstrap HTML code, is javascript. If your object is to hide your content from browsers configured as I just mentioned, the second code can be modified to do so:

    Code:
    <a href="javascript:void()" onclick="parent.iFrameName.location.replace('filename.ext');return false;"><img src="thumbnail.ext"></a>
    If your object is not to replace the contents of the other iframe but rather, an image element within it:

    Code:
    <a href="imageFilename.ext" target="iFrameName" onclick="parent.iFrameName.getElementById('id_of_image_element').src='imageFilename.ext';return false;"><img src="thumbnail.ext"></a>
    It is hard to be more specific, not knowing what exactly you want to do and not knowing what you would like the consequences to be for non-javascript enabled browsers.
    - John
    ________________________

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

  5. #5
    Join Date
    Dec 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ok i will try to be more specific.
    i have two iframes. let me call them left and right. the left iframe is scrollable, and has thumbnails, which are clickable. the right iframe is a blank iframe, and is not scrollable. Upon clicking on the thumbnails in the left iframe the thumbnails will pop up in the right iframe. so what i want to do is to be able to link the left iframe to the right one.
    prefferably without using codes.

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

    Some kind of code(s) will be required. My second example, from my first post in this thread sounds like it will do the job.

    You still haven't answered what you have against HTML. I guess I wasn't specific in asking that question, so I will do so now:

    What do you have against HTML?

    Some HTML is required or there will be no page in the left iframe.

    I have another question. Have you at least tried out any of my suggestions yet, to see how they work?
    - John
    ________________________

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

  7. #7
    Join Date
    Dec 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hey john, i figured out how to do the iframes without using codes...
    thanks for the help though.

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

    Mostly because I really still don't understand what exactly you were trying to do, would you mind telling us the solution?
    - John
    ________________________

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

  9. #9
    Join Date
    Oct 2005
    Posts
    121
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Basically it sounds like he wants one iframe for navigation of topics, and another to display them in. this is actually a confusing problem for some (that dont entirely understand frame targeting), with a REALLY simple solution (link targeting between regular frames and iframes is the same btw).
    i've tested it out and::::::::::::

    container page (the one with both iframes)
    Code:
    <body>
    <iframe src="test_1.htm" name="nav_frame" width="30%">
    <iframe src="content_link_1.htm" name="content_frame" width="30%">
    </body>
    source for Navigation frame
    Code:
    <body>
    TEST 1
    <p><a href="content_link_1.htm" target="content_frame">link1</a></p>
    <p><a href="content_link_2.htm" target="content_frame">link2</a></p>
    </body>
    then just make each content page however the heck you want, though personally I recommend NOT using javascript menus (like the ones posted in d-drive) inside the content pages, or things can get confusing. and make SURE that any links in the iframes target the correct frame you want ("content_frame" for the content, "_new" for a new window, and I think "_parent" to make the link take over the page containing the iframe)

    and btw, theres NOTHING wrong with HTML, its the ENTIRE WEB, it would be WAY too inefficient to do everything with just javascript
    Last edited by sleipner; 12-13-2005 at 08:02 PM. Reason: forgot what tags d-drive forums supports, getting used to slashdot...

  10. #10
    Join Date
    Dec 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks all...
    i did it the easy way, without using code. I used the dreamweaver iframe icon. It was just the targeting that I was having problems with. But the codes that I got from the forum helped me figure that out.
    Thanks. i guess codes are not too bad once you get familiar with them...

    Today I have a different problem
    I was linking all my links in dreamweaver. When I was done I uploaded it to the site. However due to naming of files, the host could not read some files that were capitalised. So I renamed the files, and the host was able to read the files. However, due to the renaming, some of the files lost the links. There are almost 70pages that need to be relinked. I could do each one, one at a time. But I was wondering if dreamweaver has a way of automatically relinking the lost links. Because essentially nothing has changed, except the name of the folders.
    Last edited by bluegasps; 12-16-2005 at 12:07 AM.

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
  •