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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:03:54+00:00 2026-05-29T09:03:54+00:00

Basically this function is meant to store the height value of the element that

  • 0

Basically this function is meant to store the height value of the element that calls it and then if that height matches the element it will expand its height by 200px and if it does not match the stored value it restores that value (in essence shrinking the element container). How do I get it to read from the external style sheet to get the var heightVal = parseInt(boxStyle.height);?

function expand(e){
  var box = document.getElementById(e);
  var boxStyle = box.style;
  var heightVal = parseInt(boxStyle.height);

  if(boxStyle.height == heightVal){
    boxStyle.height = heightVal + 200 +'px';
  }
  else{
    boxStyle.height = heightVal;
  }

}
  • 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-29T09:03:55+00:00Added an answer on May 29, 2026 at 9:03 am

    This is my revised answer… This code allows for the function to be used universally to re-size any elements height regardless of whether you want it to start minimized or maximized and/or whether you want it to expand or collapse. I developed this function as an improvement on the answer I had previously written. This is actually a result of another function I have been working on to change the CSS class to allow for animation without using either javascript nor jquery. I now have both functions working and universal!

    The parameters are pretty straight forward… box represents the element you want to resize, hNew represents the height you want to resize it to (can be larger or smaller than the current height of the element and the function still works).

    function resize_height(box, hNew){
      if(box.style.height != hNew || box.style.height == box.old_height){
        box.old_height = box.style.height
        box.style.height = hNew;
      }
      else{
        box.style.height = box.old_height;
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Briefly dismiss the fact that normal function overloading will serve this example better. It
The criteria is basically this: folders will exist for about 24-48hrs folders names can
My understanding is that Ladner's theorem is basically this: P != NP implies that
Basically what this does is fadeIn pre-existing divs and then loads an image. When
Basically this code below returns the right information, but I need to add the
Basically this is a question how to access local scope handler. I trying to
So basically this code was working fine before. I had some computer issues and
The problem is basically this, in python's gobject and gtk bindings. Assume we have
I'm working on a new CMS to use on repeative projects. Basically this chunk
Im trying do this basically: var tr = document.createElement(tr); var td = document.createElement(td); td.appendChild(document.createTextNode('<input

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.