Advanced Search

Results 1 to 8 of 8

Thread: iframes w/ referanced html file.... confusing problem

  1. #1
    Join Date
    Jan 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default iframes w/ referenced html file.... confusing problem

    so heres one that im not sure is even possible, but im sure one of you guys can figure it out.

    i have three iframes inside a table. the bottom frame has my buttons for my page that i want to link to all my different pages, but i want them to load in the center Iframe of the page. here's the trick.

    the bottom iframe referances a seperate html file with the buttons in it. that's why im having a problem linking the the button to load the page in the center Iframe......


    Does this make since to anyone??? any help would be awesome. Thanks!!!

    ::sWc::
    Last edited by scotty.campbell; 01-14-2006 at 04:36 AM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,708
    Thanks
    43
    Thanked 3,133 Times in 3,097 Posts
    Blog Entries
    12

    Default

    Please don't double post . . .

    Sounds doable but, I would need to see what you have. Preferably a link to your pages. They don't have to work. Or you could post or attach your code here. If you post code, be sure to do it like so:

    [code]

    code goes here

    [/code]

    That way it will look like this:

    Code:
    code goes here
    - John
    ________________________

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

  3. #3
    Join Date
    Jan 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    yea i tried to figure it out from that other post, but it's a little different.

    Code:
    <html>
    <head>
    <META HTTP-EQUIV =" imagetoolbar" CONTENT="no">
    <title>::sWc::</title>
    </head>
    <body bgcolor="#f0f0f0" leftmargin="0" marginheight="0" marginwidth="0" topmargin="0">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
    <tr>
    <td>
    <div align="center">
    <table width="770" border="0" cellspacing="0" cellpadding="0" bgcolor="white" height="540">
    <tr>
    <td rowspan="3"><IFRAME name=top src=top.htm width=770 height=45 frameborder=0 scrolling=no></iframe>
                    <IFRAME name=content src=content.htm width=770 height=440 frameborder=0 scrolling=no></iframe>
                    <IFRAME name=bottom src=bottom.htm width=770 height=110 frameborder=0 scrolling=no></iframe></td>
    </tr>
    
    <tr>
    </tr>
    <tr>
    </tr>
    </table>
    </div>
    </td>
    </tr>
    </table>
    </body>
    </html>
    so what im trying to do is get the buttons that are in iframe bottom.htm to load the content in the iframe name=content. The thing that's different about this from the other posts is bottom.htm has the buttons in it and it's loaded into the page. The buttons aren't in the frames, so im not sure how to link them up.

    thanks for the help guys, im just learning

    sWc

  4. #4
    Join Date
    Jan 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    heres a link to the page so you can see what im trying to do

    http://www.swc3d.com/html/

    thanks for the help

    sWc

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,708
    Thanks
    43
    Thanked 3,133 Times in 3,097 Posts
    Blog Entries
    12

    Default

    I downloaded your page using FF as a 'Web Page Complete". I then simply added the target attribute to the links on bottom.htm like one would if this were a traditional frames page and it worked fine in IE, FF and Opera. In case you don't know how that is done, it is like so:

    HTML Code:
    <a href="whatever.htm" target="content">Whatever</a>
    With a link like that on bottom.htm, when clicked, whatever.htm will be loaded into the central iframe named "content" on the top page.

    This is the simplest and best method, as it doesn't rely upon javascript at all. It is straight HTML code and therefore will be accessible to virtually all iframes compliant browsers.
    - John
    ________________________

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

  6. #6
    Join Date
    Jan 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    awesome! thanks for your help. I dont know why i couldn't get it to work like that before, but thanks for clearing it up for me

    scott

  7. #7
    Join Date
    Jan 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up i got my iframes working

    Put this before the html tag!

    <script type="text/javascript">
    /*************************************************************************
    This code is from Dynamic Web Coding at http://www.dyn-web.com/
    See Terms of Use at http://www.dyn-web.com/bus/terms.html
    regarding conditions under which you may use this code.
    This notice must be retained in the code as is!
    *************************************************************************/

    // resize fix for ns4
    var origWidth, origHeight;
    if (document.layers) {
    origWidth = window.innerWidth; origHeight = window.innerHeight;
    window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
    }

    function loadExternal(url) {
    if ( window.frames['ifrm'] ) {
    window.frames['ifrm'].location = url;
    return false;
    } else if ( document.layers ) {
    document.layers['outer'].document.layers['inner'].src = url;
    return false;
    } else return true;
    }

    </script>


    These are the link that i used!
    added these to the locations where you want the links showed!


    <a class="menulink" href="news.html" onClick="return loadExternal(this.href)">&nbsp;&nbsp;Home</a>
    <a class="menulink" href="forum.html" onClick="return loadExternal(this.href)">&nbsp;&nbsp;Forum</a>


    Put this in side of the table where you want the iframe to be in!

    <iframe id="ifrm" name="ifrm" src="news.html" width="560" height="795" scrolling="yes" frameborder="0"></iframe>



    http://nalan.org/new
    this is my example of the above iframes.
    enjoy!

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    John's method
    a) is simpler
    b) is more compatible
    c) was there first.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •