Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Scrolling, Frameborder, and Allowtransparency Attributes in IE.

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #32677
    cnwtx
    Member

    I am working on a website here. I am using iframes for the navbar and footer. Because of IE 8 and older I must set the following attributes on the iframes: allowtransparency=”true”, frameborder=”0″, and scrolling=”no”. None of these will validate, so therefore I am using JavaScript to set these attributes using the following code:


    onload = function()
    {
    var theframes = document.getElementsByTagName( 'iframe' );
    for( var i = 0; i < theframes.length; i++ )
    {
    theframes.setAttribute( "frameborder", "0" );
    }
    for( var i = 0; i < theframes.length; i++ )
    {
    theframes
    .setAttribute( "allowTransparency", "true" );
    }
    for( var i = 0; i < theframes.length; i++ )
    {
    theframes
    .setAttribute( "scrolling", "no" );
    }
    }

    I have also tried this:


    onload = function()
    {
    var theframes = document.getElementsByTagName( 'iframe' );
    for( var i = 0; i < theframes.length; i++ )
    {
    theframes.setAttribute( "frameborder", "0" );
    theframes
    .setAttribute( "allowTransparency", "true" );
    theframes
    .setAttribute( "scrolling", "no" );
    }
    }

    Both of these only the allowtransparency works. I am still a novice to Javascript and any help would be appreciated.
    The page using this code can be found here. (Note that this is the 404 error page.)
    -Cliff

    #76822
    hardik
    Member

    it could be iframe browser security issue, you cannot set some attributes via javascript on iframes.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.