Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11

Thread: iFrames Help

  1. #1
    New Coder
    Join Date
    Oct 2002
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy iFrames Help

    This is hard to explain now.
    How do make it so that each link loads diff content in an iFrame(mine is called start.html). This is really hard for me to explain. Do I have to make one iFrame for each link?

  • #2
    Regular Coder
    Join Date
    Dec 2002
    Location
    Minneapolis, MN
    Posts
    208
    Thanks
    0
    Thanked 1 Time in 1 Post
    your links on start.html would look like this...

    Code:
    <a target="frameName" href="page.html">link</a>
    and then in your iframe code add a name and id attribute like so.

    Code:
    <iframe src="default.html" name="frameName" id="frameName"></iframe>
    this will tell the link to load inside the iframe.
    anthony

  • #3
    New Coder
    Join Date
    Oct 2002
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by ez4me2c3d
    your links on start.html would look like this...

    Code:
    <a target="frameName" href="page.html">link</a>
    and then in your iframe code add a name and id attribute like so.

    Code:
    <iframe src="default.html" name="frameName" id="frameName"></iframe>
    this will tell the link to load inside the iframe.
    start.html is my iFrame. I'm telling the links to load in iFrame. So.. I do it the other way around?

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Cincinnati, OH
    Posts
    545
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If I understand you right this can be done with javascript and all you need is one iframe.

    function submitToIFrame(url) {
    document.frames("iLinks").src=url;
    }

    <a href="javascript:submitToIFrame('testPage.html')">TestPage</a>

    <iframe id="iLinks">
    </iframe>

    For each link you are dynamically setting the src of the iframe.

  • #5
    Regular Coder
    Join Date
    Dec 2002
    Location
    Minneapolis, MN
    Posts
    208
    Thanks
    0
    Thanked 1 Time in 1 Post
    i know it's a hard concept to follow... look at this simple example.

    http://rap.midco.net/ez4me2c3d/html/iframe.html
    anthony

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    Cincinnati, OH
    Posts
    545
    Thanks
    0
    Thanked 0 Times in 0 Posts
    duh I never work with frames and I have always just used js with my iframes. Oh well I guess you learn something everyday.

  • #7
    New to the CF scene
    Join Date
    Dec 2002
    Location
    Canada
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    How do you change the colours of those iFrames?

  • #8
    Senior Coder
    Join Date
    Jul 2002
    Posts
    1,628
    Thanks
    0
    Thanked 0 Times in 0 Posts
    an iframe is a frame displaying a seperate document, to change the colors of the frame would be to change the background color of the document the iframe is showing ...

    http://search.microsoft.com/gomsuri....cts/iframe.asp

    Moderator: General web building

    Get out from under them, resist and multiply.
    Get out from under precipice and see the sky.

  • #9
    New Coder
    Join Date
    Oct 2002
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool

    Sweet! I actually got it to work! I used what EZ posted it worked. I've been reading and learning a bit about HTML and then going to ASP . Now.... how do I change the size of the iFrame ?

  • #10
    Regular Coder
    Join Date
    Jun 2002
    Location
    United Kingdom Confused: Often
    Posts
    859
    Thanks
    0
    Thanked 0 Times in 0 Posts
    how do I change the size of the iFrame ?
    <iframe ... width="400" height="400">
    redhead

  • #11
    New Coder
    Join Date
    Oct 2002
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool

    Originally posted by redhead
    <iframe ... width="400" height="400">
    Ohhh! Right, I knew that, just wasn't thinking .


  •  

    Posting Permissions

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