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 5992729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:34:28+00:00 2026-05-22T23:34:28+00:00

I want to hide elements of an website loaded in an iFrame. The script

  • 0

I want to hide elements of an website loaded in an iFrame. The script and the site can take a while so it is requested that the iFrame content is only shown after it has been modified.

I use an onload event to execute the script which hides the elements. I have access to the iFrame content (it’s on the same domain, but not the same server / network).

function frameLoaded() {
sleep(3000); //simulating the time the script needs
var leftDiv = window.frames.testFrame.document.getElementById("leftcol");
leftDiv.style.display = "none";
}

The simple sleep function:

function sleep(milliSeconds){
var startTime = new Date().getTime(); // get the current time
while (new Date().getTime() < startTime + milliSeconds); // hog cpu
}

When the Website with the iFrame is loaded for the first time a scroll-bar and some styled elements are shown, but no content text:

http://img651.imageshack.us/img651/5082/beforeu.png

When the script is done the page is displayed as it should be (the azure colored div becomes hidden):

http://img51.imageshack.us/img51/6806/afterq.png

While the script is working there shouldn’t be displayed anything. Either an empty iframe or the whole website waiting till the onload is finished would be sufficient.

  • 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-05-22T23:34:29+00:00Added an answer on May 22, 2026 at 11:34 pm

    You could have the <iframe id="iframe" style="display: none"> hidden on your parent page load and on the onload event of the iframe set this one to visible:

    function frameLoaded() {
      sleep(3000); //simulating the time the script needs
      var leftDiv = window.frames.testFrame.document.getElementById("leftcol");
      leftDiv.style.display = "none";
      document.getElementById("iframe").style.display = 'block';
    }
    

    BTW: This sleep function should be thrown away.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to hide all the elements on the page that end in _dropMenu
Suppose I want to show/hide elements based on Values of Properties from DataContext, how
I am trying a new functionality for my web site. I want to do
So I'm designing a website (using WordPress), and I want to use JQuery to
I have an element that serves as the banner on my website. This banner
I am working on a site that will involve a lot of Javascript to
I want to check if the value true is present in a db and
I have an app that is built as a hierarchy of viewControllers. On of
I've written a custom authorization attribute derived from System.Web.Mvc.AuthorizeAttribute . I'm using it successfully
gcc 4.4.4 c89 I have this in my header file. port.h struct struct_tag; int

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.