IE bug/issue with changing the frameset properties through DHTML

Discussion in 'Javascript' started by Berlin Brown, Apr 28, 2008.

  1. Berlin Brown

    Berlin Brown Guest

    http://www.w3schools.com/htmldom/prop_frame_scrolling.asp

    I want to be able to get this example working with Internet explorer.
    it works fine in firefox. Does anyone have an idea how to resolve
    this bug.

    'Basically, I want to be able to change the properties of a frame
    after the properties have been defined.

    E.g. turn scrolling from "no" to "yes"
     
    Berlin Brown, Apr 28, 2008
    #1
    1. Advertisements

  2. hmm, well since no one else is stepping up, i'll give an attempt. if
    this leads to a correction, hey, at least it will prove
    educational :).

    based on the link you provided, i tinkered around with it, and came up
    with:

    // add this to the enableScrolling() function
    parent.document.getElementById("leftFrame").style.overflow="scroll"
    parent.document.getElementById("rightFrame").style.overflow="scroll"

    // add this to the disableScrolling() function
    parent.document.getElementById("leftFrame").style.overflow="auto"
    parent.document.getElementById("rightFrame").style.overflow="auto"
     
    nolo contendere, Apr 28, 2008
    #2
    1. Advertisements

  3. woops, that adds something weird in IE. well, this works, although it
    refers to the body of one frame--the frame in which the javascript
    code resides, so i don't know if it's what you want...

    <script type="text/javascript">
    var left = parent.document.getElementById("leftFrame");
    var right = parent.document.getElementById("rightFrame")

    function enableScrolling()
    {
    document.body.style.overflow="scroll"

    left.scrolling="yes"
    right.scrolling="yes"
    }
    function disableScrolling()
    {
    document.body.style.overflow="auto"

    left.scrolling="no"
    right.scrolling="no"
    }


    </script>
     
    nolo contendere, Apr 28, 2008
    #3
  4. Berlin Brown

    Berlin Brown Guest

    This code actually works; there is just one problem. IE doesn't
    handle the width of the body content properly. Once again, FF gets it
    right.

    E.g. I have scrollbars enabled for the frameset page, but scrollbars
    only expand to the visible content.

    For example, if I have a window of 2000 pixels. And only 700 pixels
    are available on screen. The horizontal scrollbars only expand 700
    pixels. Which doesn't make sense because it renders the scrollbars
    useless.

    It doesn't matter, I consider IE the worst piece of software; I blame
    them.
     
    Berlin Brown, Apr 30, 2008
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.