Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9226389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:49:06+00:00 2026-06-18T04:49:06+00:00

I am working on web application which contains different number of nested frames and

  • 0

I am working on web application which contains different number of nested frames and iframes.
Currently when web page renders browser renders scroll bars against them. Sometimes count is 4-5 scroll bar in a page which looks very ugly. So I want to remove these scroll-bars through Javascript.

To understand the problem, Please see below example of web page with frame/iframe hierarchy.

 Frame1
       --Frame2
       --Frame3
              --Frame4
              --Frame5

My approach :
Start from the root document and search all frames/iframes from the page and put these frame node in Array with additional variable called level.
After completion of this I am sorting the array on level. So after this activity array will look like.Below

     0> Frame5 node, level=3
     1> Frame4 node, level=3
     2> Frame3 node, level=2
     3> Frame2 node, level=2
     4> Frame1 node, level=1

After this I am considering two option to remove scroll-bar

Option #1 :
start from 0th element from array and get scrollheight of frame and set it to height property of Frame.

var frameScrollHeight=Frame5.contentWindow.document.body.scrollHeight;
Frame5.style.height =frameScrollHeight;

Do same procedure for every frame in array.
My assumption here is that If innermost frames height changes, Its parent nodes scroll Height must changes to true scrollheight.
e.g After setting the Frame5 and Frame4 height. when we fetch scrollheight of Frame3 it must be Frmae5 height +Frame4 height. But now its not reflecting the true scrollheight.
I am not sure what is wrong here. When we set Frame5 and Frame 4 height will Dom refreshes immediately? .
Am i using wrong property? because I verified all other proprieties also using script debugger like clientHeight,offsetHeight but no one equivalent to Frame5 height+ Frame4 height.

Option #2
As above approach is not working correctly I took another approach of adding previous level frames height manually and set it to parent node in next level.
e.g Get scrollheight of Frame5 and Frame4 and set it to Frame3 Also add height of Frame3 and Frame2 and set it to Frame1.

Option two is working now but still it has some drawback like all frames must be in hierarchical order and must not be in parallel to each other.

Also when I am setting scrollheight as height to Frame scroll-bar still appears as it is and I have to add some constant like 15 to scrollheight. So actual code is like

var frameScrollHeight=Frame5.contentWindow.document.body.scrollHeight+15;
Frame5.style.height =frameScrollHeight;

I don’t know what this 15 is. Is it a frameborder? Can I get this constant using any property of frame?

I will prefer option 1 but don’t know why this is not working.
If there is any other way to solve this problem please suggest.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:49:07+00:00Added an answer on June 18, 2026 at 4:49 am

    I had the same problem and the following function (using jquery) worked for me after I converted all frames to iframes. This function will resize every frame so that there is no need for scrollbars:

    var resizeFramesSoAllContentVisible = function (win) {
        for (var i = 0; i < win.frames.length; i++) {
            var frame = win.frames[i];
            var contentWindow = frame.contentWindow ? frame.contentWindow : frame.window;
            resizeFramesSoAllContentVisible(contentWindow);
        }
    
        if (win.frameElement) {
            var myFrameOuterHeight = $(win.frameElement).height();
            var myFrameInnerHeight = $(win.document).height();
            var myFrameOuterWidth = $(win.frameElement).width();
            var myFrameInnerWidth = $(win.document).width();
    
            if (myFrameOuterHeight != myFrameInnerHeight) {
                $(win.frameElement).height(myFrameInnerHeight);
            }
            if (myFrameOuterWidth != myFrameInnerWidth) {
                $(win.frameElement).width(myFrameInnerWidth);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working on an advanced web application that contains a number of
I'm working on an MVC3 Razor web application which gets it's page decoration from
I am currently working on a web application. I was just wondering which has
I'm working on Asp.net MVC3 web application. I'm having one page on which appx.
I am currently working on a roughly 15 years old web application. It contains
I'm working profesionally on a php web application which contains contacts, among other data.
I am working on a web application which must be able to encrypt data
I have one web application which I have been working for some time.I am
I'm working on a web based application which uses a JSON over HTTP based
Well, simple question. I'm working with VS2008 on an ASP.NET web application which has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.