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

  • Home
  • SEARCH
  • 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 6374831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:32:15+00:00 2026-05-25T01:32:15+00:00

Ive got a javascript calculating the height of a iframe element and the document

  • 0

Ive got a javascript calculating the height of a iframe element and the document height. Then use a if to see if the iframe element is on or off. When its off the height is 1px and display is none. When its on the height is 34px and display is block. I do all this with another function that is irrelevant to this question. The question is why when I change pages if the height is less then the previous page it dosen’t recalculate the height and set it correctly, BUT if the height is bigger then the previous page it does recalculate and sets the height acordingly. Im using a onload=”javascript:autoHeight” on the body tag of every page so that it recalls the function every time the diferent page loads and only when its done loading so it gets the height correctly. If you need more code: http://alomadruga.com.br/temp/home.php

function autoHeight(){
var docHeight = $(document).height();
var radioHeight = parent.$("#radioiframe").height();
if (radioHeight == 34){
    parent.$('#content').css({'height': docHeight + 34+ 'px'});
    alert("radio iframe is on");
}
else {
    parent.$('#content').css({'height': docHeight+ 'px'});
    alert("radio iframe is off");
}
};

Thanks for every ones help but I managed to figure it out on my own and decided I would post the answer to help whoever comes by this question. What i did is that every time it runs the function I set the height to 1px first then let it run the function.

function autoHeight(){
    parent.$('#content').css({'height': 1+ 'px'});
var docHeight = $(document).height();
var radioHeight = parent.$("#radioiframe").height();
if (radioHeight == 34){
    parent.$('#content').css({'height': docHeight + 34+ 'px'});
    alert("radio iframe is on");
}
else {
    parent.$('#content').css({'height': docHeight+ 'px'});
    alert("radio iframe is off");
}
};
  • 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-25T01:32:16+00:00Added an answer on May 25, 2026 at 1:32 am

    Try to apply this CSS:

    html {height:100%}
    
    body {
        margin:0; padding:0;
        height:auto !important;
        height:100%;
        min-height:100%;
        position:relative;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok so Ive got this Javascript file, simply: $(document).ready(function() { $('.status').prepend(<div class='score_this'>(<a href='#'>score this
Ive got this function as a html helper which should write a javascript function
Im really really new to Javascript but Ive got this script that loads the
I've got following JavaScript functions but want to refactor the $(document).ready() as I've got
Ive got some particularly nasty Javascript I am trying to debug. Specifically, I am
Ive got a really strange problem with some javascript code that ive written. I
I've got this script for calculating square area, which works perfect: <script language=javascript type=text/javascript>
Ive got some form validation on my page thats ment to display an error
I've got this JavaScript/jquery code: $(document).ready(function() { var audioElement = document.createElement('audio'); var secondtrack =
I've got a javascript file being added dynamically to a page. If I use

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.