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: iframe Dilemma

  1. #1
    New Coder
    Join Date
    Feb 2007
    Location
    Albany, Oregon
    Posts
    66
    Thanks
    3
    Thanked 0 Times in 0 Posts

    iframe Dilemma

    I am trying to have an iframe automatically resize to fit the content inside it. Here is what I have:

    HTML:
    Code:
    <iframe class="teacherpage" frameborder="0" src="http://www.albany.k12.or.us/wahs/teacherpages/harveysylvia/home.php"></iframe>
    CSS:
    Code:
    .teacherpage {
      overflow-x: hidden;
      width: 650px;
    }
    edit: I have searched for a solution, but all the ones I see call for code to be inserted into each page that is being displayed in the iframe. This is a major problem for me since I am designing these pages for the teachers at my school. There are sixty plus teachers all with many pages, and it would be very difficult to go back through each page and insert some code.
    Last edited by zach4618; 05-11-2007 at 09:30 PM. Reason: Forgot something

  • #2
    New Coder
    Join Date
    Feb 2007
    Location
    Albany, Oregon
    Posts
    66
    Thanks
    3
    Thanked 0 Times in 0 Posts
    anyone?

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    If the url is on another domain than the iframe then you won't be able to resize the iframe dymnamically any way due to security issues. If you are working on a page that is on the same domain as the src of the iframe then yes its possible. It will require javascript. The script found here doesn't require that you put anything into the pages that are to open in the iframe.
    http://www.dynamicdrive.com/dynamici...iframessi2.htm
    Last edited by _Aerospace_Eng_; 05-15-2007 at 06:43 AM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #4
    New Coder
    Join Date
    Feb 2007
    Location
    Albany, Oregon
    Posts
    66
    Thanks
    3
    Thanked 0 Times in 0 Posts
    I get a page not found error for that URL.

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Just click it, don't try copying and pasting it.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #6
    New Coder
    Join Date
    Feb 2007
    Location
    Albany, Oregon
    Posts
    66
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Seems to work just fine. Thanks.

  • #7
    New Coder
    Join Date
    Feb 2007
    Location
    Albany, Oregon
    Posts
    66
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Firefox is adding right and bottom scrollbars to the page, even though scrolling is set to no. It works in IE just fine though.

  • #8
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Got link?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #9
    New Coder
    Join Date
    Feb 2007
    Location
    Albany, Oregon
    Posts
    66
    Thanks
    3
    Thanked 0 Times in 0 Posts
    http://www.albany.k12.or.us/wahs/teacherpages/test.php

    I changed the overflow from visible to hidden and the width from 100% to 655px and that seems to fix the problem.

  • #10
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Out of curiosity how did you get the job for webmaster for the school? Are you a student or something? Also I advise against the use of tables for page layout. Read: "Why Tables for Layout is Stupid?"
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #11
    New Coder
    Join Date
    Feb 2007
    Location
    Albany, Oregon
    Posts
    66
    Thanks
    3
    Thanked 0 Times in 0 Posts
    I am a student at West Albany HS. Last year I took a class called computer applications and then advanced computer applications the next semester. The teacher of those classes is the webmaster of the schools website. I did well in the classes and he asked me if I would like to help him out. He is also the band director so he is very busy and has little time to update the site. I now maintain everything and recently I have been working on getting pages up for all the teachers.

    And by the way, I do use divs for layout, but the majority of the site was done when I started. The district has a template for all the schools to use that we can't change. (Click on the "Select a school" drop down box). The only part of the site that I have complete control over is the teacher pages, which I designed from scratch. They are laid out with divs.


  •  

    Posting Permissions

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