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 8 of 8
  1. #1
    Regular Coder
    Join Date
    Jul 2003
    Location
    Denmark
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts

    iframe and double scrollbars

    I'm building a site containing a forum. I'm using phpBB2 which works fine. In order to integrate the forum in my page I'm opening it in an iframe.

    When a thread contains many posts a scrollbar will appear in both the iframe and the browser because the iframe cannot adjust to the content. Right?

    Is there a better way to do this? I want the forum as a part of the page and meddling with the php is out of the question.

    Cheers,
    Mz

  • #2
    Regular Coder
    Join Date
    Aug 2002
    Location
    USA
    Posts
    625
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The default value for scrolling is auto. To disable it,
    use scrolling="no". Although, I'm sure you want scrollbars in the iframe. In the parent window, you can use scroll="no" in the <body> tag, for IE, but this requires Universal Browser Write privileges in Gecko-based browsers. You can script it, but it will produce a regretably unwarranted [imo] prompt in this circumstance.

    Are you using an absolute height for your iframe?


    -james
    "God so loved the world that he gave his only begotten son, so that whosoever believed in him would not perish, but have everlasting life. For God did not send his son into the world to condemn the world, but so that through him the world might be saved. "

  • #3
    Regular Coder
    Join Date
    Jul 2003
    Location
    Denmark
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts

    You misunderstood

    The problem is not how to disable the scrollbars.

    Actually it's wether or not I can make my iframe adjust to the content.

    Look at this link: plagiator.dk.

    Notice how I've made the height of the iframe very large in order to avoid the double scrollbars. In some threads in the forum, though, it's not enough. I could just make the height 10000px but is there a way to make the height adjust?

    Thanks
    Mz

  • #4
    Regular Coder
    Join Date
    Aug 2002
    Location
    USA
    Posts
    625
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You misunderstood
    No, I don't think I did.

    If the height of your iframe exceeds the height of the page in Gecko-based browsers, you will end up with two vertical scrollbars--one for the browser window, and one for the iframe. However, in IE, you can disable scrollbars, so you can make your iframe any height you want, and will only get one set of scrollbars--those of the iframe, which in your case, would solve your problem, i.e, the iframe scrollbars will adjust to the height of the content. But in Gecko, as stated earlier, you have to have Universal Browser Write privileges to disable scrollbars in the parent window.


    So to answer your question, you end up with 2 scrollbars, not because the iframe cannot adjust to the height of the content--it does that automatically, just like the browser window--but you end up with 2 sets of scrollbars, because Gecko considers removing scrollbars from the parent window as a security breach, something I don't agree with...


    Anyway, as I already said, if you add <body scroll="no"> I think you will get the result you want, but only in IE..



    If you still think I've misunderstood, I'll let someone else take a stab at it.
    -james
    "God so loved the world that he gave his only begotten son, so that whosoever believed in him would not perish, but have everlasting life. For God did not send his son into the world to condemn the world, but so that through him the world might be saved. "

  • #5
    Regular Coder
    Join Date
    Aug 2002
    Location
    USA
    Posts
    625
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You misunderstood
    No, I don't think I did.

    If the height of your iframe exceeds the height of the page in Gecko-based browsers, you will end up with two vertical scrollbars--one for the browser window, and one for the iframe. However, in IE, you can disable scrollbars, so you can make your iframe any height you want, and will only get one set of scrollbars--those of the iframe, which in your case, would solve your problem, i.e, the iframe scrollbars will adjust to the height of the content. But in Gecko, as stated earlier, you have to have Universal Browser Write privileges to disable scrollbars in the parent window.


    So to answer your question, you end up with 2 scrollbars, not because the iframe cannot adjust to the height of the content--it does that automatically, just like the browser window--but you end up with 2 sets of scrollbars, because Gecko considers removing scrollbars from the parent window as a security breach, something I don't agree with...


    Anyway, as I already said, if you add <body scroll="no"> I think you will get the result you want, but only in IE..



    If you still think I've misunderstood, I'll let someone else take a stab at it....Good luck!




    -james
    "God so loved the world that he gave his only begotten son, so that whosoever believed in him would not perish, but have everlasting life. For God did not send his son into the world to condemn the world, but so that through him the world might be saved. "

  • #6
    Regular Coder
    Join Date
    Jul 2003
    Location
    Denmark
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts
    At the moment I'm not sure if I'm the one misunderstanding...

    Did you have a look at the site?

    I don't want scrollbars in the iframe. I want it to adjust to the content just like a div would do.

  • #7
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Why are you using a frame at all? Create a new PhpBB template that matches your site.

  • #8
    Regular Coder
    Join Date
    Jul 2003
    Location
    Denmark
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey, I managed to create something that worked! Thanks.

    I just need to adjust and redesign the template now to fit my needs.

    Take a look again at http://plagiator.dk/phpBB2/ in IE and see how the forum table with width="100%" is 100% of the window and not of the parent div (as it should be and is in Moz).

    What do I do?


  •  

    Posting Permissions

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