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

The Archive Base Latest Questions

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

Im running in to a weird issue with getting the width of the document.

  • 0

Im running in to a weird issue with getting the width of the document. Im using $(document).width() to get the width both on $(window).load and $(window).resize, my problem occurs when the browser is open full screen then resized (shrank) to a width where the content requires you to scroll horizontally to see all the content. At the point in which you need to scroll my header and footer divs just end. I would like them to go 100% of the document width. The problem fixes itself when i refresh the page. Is there a solution that allows a browser to shrink when resizing the window and updates the header and footer divs? This is what i have so far and its not working.

$(window).load(function() {
    resize_me();
});
$(window).resize(function() {
    resize_me();
});
function resize_me() {
    var doc_width = $(document).width();
    $('#header').width(doc_width);
    $('#footer').width(doc_width);
    console.log(doc_width);
}
  • 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:42:33+00:00Added an answer on May 25, 2026 at 1:42 am

    try window.innerWidth, it should get you the size of the viewport.

    No jQuery needed.

    and honestly, why not just set their widths to 100% with css ???

    #header, #footer {
        width:100%;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running into a weird issue when using -webkit-overflow-touch on iOS Safari. I
I'm getting a weird issue in IE 8. Here's what we got. Running Asp.net
I'm running into a weird issue with reflection in Scala 2.10.0 Milestone 4 that
I'm running into a weird issue that I'm struggling to figure out what's causing
I have extended SimpleCursorAdapter and am running into a weird issue with bindView, which
Trying to set up a new project, and running into a weird issue. I
I'm learning and testing some graph libraries and am running into a weird problem(but
I'm getting some weird differences when running Nokogiri locally versus running it on my
I am getting this weird error while running cucumber test: ERROR Mongo::OperationFailure: Database command
I'm running a weird issue here. I have code that makes jquery ajax calls

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.