dcsimg
www.webdeveloper.com
Results 1 to 11 of 11

Thread: iFrame Targeting

  1. #1
    Join Date
    Aug 2005
    Location
    Texas, USA
    Posts
    13

    Exclamation iFrame Targeting

    I am using iFrames on my site. I have the following main iFrames in use:

    Side Menu
    Document
    Sub Menu (Right)

    Here is my situation. I am targeting links ffrom the Side Menu iFrame to load pages into the Document iFrame. I am wanting to be able to click one link in the Side Menu iFrame, and be able to load a page into my Document iFrame and a completely different one into my Sub Menu iFrame.

    I need to know what technology I need to use to do this. I only know XHTML and CSS, but am willing to also use JS, but would rather stick to either CSS or XHTML. Is this possible?

    Here is the website being used for a visual example - Site.

    For a detailed explanation. I want to be able to go from the homepage (index) and click on my journals link and be able to load all the blog posts into my Document and load the archive into the Sub Menu. Thanks ahead of time for your help.

    Oiy, and I may be no c0demast3r, but that is a goal..........

  2. #2
    Join Date
    May 2004
    Location
    Manhattan NY
    Posts
    6,028
    Please don't post the same issue in more than one of the forums. The other was removed, this one will remain. Thank you.

  3. #3
    Join Date
    Apr 2005
    Location
    Bathurst, NSW, Australia
    Posts
    3,357
    <body onload="parent.frames[1].location.href='new.htm'">

    Modify 1 to fit the correct frame number
    Last edited by bathurst_guy; 08-28-2005 at 11:08 PM.

  4. #4
    Join Date
    Aug 2005
    Location
    Texas, USA
    Posts
    13
    I understand that.....I am using it right now. I am talking about linking 2 targets, 2 iFrames, 2 different sections of content.

  5. #5
    Join Date
    Apr 2005
    Location
    Bathurst, NSW, Australia
    Posts
    3,357
    sorry yeh i reread and edited

  6. #6
    Join Date
    Aug 2005
    Location
    Texas, USA
    Posts
    13
    okay....I get it so far, and I am sprry if I sound like a moron, but I need this to be clarified.

    <body onload="parent.frames[1].location.href='new.htm'">

    correct me if I am wrong, but <...href='new.html'"> is going to the the location of the document I want to load in the Sub Menu iFrame.

    what I dont understand though is this: <...frames[1]....>, since I have the name / id of the iFrame "rightside", is that the value I put there?

  7. #7
    Join Date
    Apr 2005
    Location
    Bathurst, NSW, Australia
    Posts
    3,357
    <...href='new.html'"> is going to the the location of the document I want to load in the Sub Menu iFrame.
    Correct, and this goes code on the page loaded into the 'document' frame

    and.. untested but you can do this i thinks
    <body onload="parent.submenu.location.href='new.htm'">

  8. #8
    Join Date
    Aug 2005
    Location
    Texas, USA
    Posts
    13
    y...one more time, before I bother ya'll too much. I am having problems with this part of the tag.

    <body onload="parent.frames[rightside].location.href='http://jbl-archive.blogspot.com/'">

    I have this tag in the "document" iFrame, because I want the Archive ("rightside") to load in that "rightside" iFrame onLoad of the document iFrame.

    This is what I have, and I have tried it a bunch of different ways by playing with the tag, and still unable to get it. I know the problem can be fixed, but I am inexperienced, so I cannot see it right now. Thanks for your help.
    Last edited by c0demast3r; 08-28-2005 at 11:57 PM.

  9. #9
    Join Date
    Apr 2005
    Location
    Bathurst, NSW, Australia
    Posts
    3,357
    try
    <body onload="parent.rightside.location.href='http://jbl-archive.blogspot.com/'">

  10. #10
    Join Date
    Aug 2005
    Location
    Texas, USA
    Posts
    13
    I did that one too, and no luck. I saw that you said it was untested, but might work, so I tested it....to no avail.

  11. #11
    Join Date
    Apr 2005
    Location
    Bathurst, NSW, Australia
    Posts
    3,357
    ok sorry to run in circles. but i just had the time to create a mokup and tried this, it worked for me.
    <body onload="rightside.location.href='http://jbl-archive.blogspot.com/'">

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