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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:11:04+00:00 2026-06-03T09:11:04+00:00

I am trying to resize a div onload without having a javascript function in

  • 0

I am trying to resize a div onload without having a javascript function in the header. So far my code looks like the code below, and while I am somewhat familiar with javascript, I am very much so a beginner.

What I am wanting to do is take a div that has a height set in the stylesheet of 100%, and subtract 60px of height on load. Am I even close, or am I lost?

EDIT: I would not be opposed to other methods of doing this. I just don’t know of any other way.

<div id="pageContent" onload="document.this.style.height = clientHeight - '60px';">
  • 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-03T09:11:06+00:00Added an answer on June 3, 2026 at 9:11 am

    I have used jQuery, as detecting window height is prone to cross-browser compatability issues. It is good practice to keep clear seperation of markup, css style, and JavaScript functionality.

    Here is a coded example of what I believe you’re trying to achieve:

    http://jsfiddle.net/AKmaB/2/


    For if you haven’t used jQuery before, make sure you include this before any of your other JavaScripts within your web page source:

    Inclusion of jQuery

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is this possible? Essentially I'm trying to create a div layout that looks like:
I'm trying to resize a div on pageload and window resize. The code bellow
I am trying to resize the image using javascript, but I am getting errors
Im trying to create a 3 column DIV that allows me to resize the
I'm trying to figure out how to have a div dynamically resize, based on
I just now start using knockoutjs. In below code am just trying to bind
I'm trying to dynamicly resize text within a div so that the text does
I'm trying to create a div containing 3 different divs: the header, the content
I'm trying to use the 'edge.create' callback function of the Facebook javascript SDK to
With a div like this: <div id=im1 class=information_message error>Error message here <a href=javascript:hide('im1')>Hide</a></div> And

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.