Results 1 to 5 of 5

Thread: Target a frame using <iframe>

  1. #1
    Join Date
    Sep 2004
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Target a frame using <iframe>

    Is it possible to href from a button to open a page in a targeted frame?

    I have several buttons that I want to use this command on so that different pages open up in the same frame that has an id?

    Thank you

  2. #2
    Join Date
    Sep 2004
    Location
    Indonesia
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Code:
    <iframe src="main_page.html" name="myframe"></iframe>
    <br><br>
    <input type="button" value="links" onclick="myframe.location.href='links_page.htm'">
    <input type="button" value="guestbook" onclick="myframe.location.href='guestbook.htm'">
    <input type="button" value="pictures" onclick="myframe.location.href='pictures.htm'">
    I hope that helps

  3. #3
    Join Date
    Sep 2004
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I do not understand where I put the following code:

    <input type="button" value="links" onclick="myframe.location.href='links_page.htm>


    Also, what if I need to define the size of the iframe and scroll it?

    Thanks

  4. #4
    Join Date
    Aug 2004
    Location
    Brighton
    Posts
    1,563
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Right, i'll break gigabites' script down:

    <iframe src="main_page.html" name="myframe"></iframe>

    These are your Iframe parameters, you can define the sizes in this line (width=90, height=90), and scrollbars=true (?)

    <br><br>

    Leaves a couple of lines


    <input type="button" value="links" onclick="myframe.location.href='links_page.htm'">

    Changes iframe location to links_page.htm

    <input type="button" value="guestbook" onclick="myframe.location.href='guestbook.htm'">

    Changes iframe location to guestbook.htm

    <input type="button" value="pictures" onclick="myframe.location.href='pictures.htm'">

    Changes iframe location to pictures.htm


    Hope this helps
    cr3ative
    A retired member, drop me a line through my site if you'd like to find me!
    cr3ative media | read the stickies

  5. #5
    Join Date
    Sep 2004
    Location
    Indonesia
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    @tacob
    Simply put that code in the page where You want the buttons (and the iframe) to appear.

    If You want a 400 x 400 iframe with no scrollbars...
    Code:
    <iframe src="main_page.html" name="myframe" width="500" height="500" scrolling="no"></iframe>
    @cr3ative
    it's scrolling="no"... I couldn't have known it without My manual though

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
  •