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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:02:31+00:00 2026-05-12T07:02:31+00:00

I have a piece of code which runs on window resize. I am pulling

  • 0

I have a piece of code which runs on window resize. I am pulling the width, and the outerWidth of a input text element.

This process works fine in every browser, except Webkit, which returns the proper result from outerWidth, but the result from width never changes from the on load original.

This is actual console output from my script when resizing the browser window (This is Chrome, but the same happens in Safari 4):

outerWidth: 772
width: 772
outerWidth: 773
width: 772
outerWidth: 773
width: 772
outerWidth: 794
width: 772
outerWidth: 794
width: 772
outerWidth: 815
width: 772
outerWidth: 815
width: 772
outerWidth: 820
width: 772
outerWidth: 837
width: 772

Has anyone experienced this before? Do you know why it happens? And most importantly, do you know how to work around it? 🙂

Thank you.

  • 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-12T07:02:31+00:00Added an answer on May 12, 2026 at 7:02 am

    Here is my test case. Both seem to work as expected (Safari 4).

    <html>
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
      <style type="text/css">
        input {
          width: 50%;
          height: 2em;
          font-size: 1em;
        }
      </style>
    </head>
    <body>
      <p>
        <input type="text" id="w" />
      </p>
      <p>
        <input type="text" id="ow" />
      </p>
      <script type="text/javascript">
        function init(){
          $('#w').val($('#w').width());
          $('#ow').val($('#ow').outerWidth());
        }
        $(function(){
          init();
    
          $(window).resize(function(){
            init();
          });
        });
      </script>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following piece of code which replaces template markers such as %POST_TITLE%
I have a piece of code in ANSI C which uses the time.h library
I have a piece of fortran code, and I am not sure which standard
I have this piece of code (summarized)... AnsiString working(AnsiString format,...) { va_list argptr; AnsiString
I have a piece of code looking like this : TAxis *axis = 0;
I have this piece of code #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <string.h>
I have this piece of code: $(#faq).click(function () { var url = $.get(faq, {
I have this piece of code: var myObj = function () { this.complex =
I have a piece of code here that i really could use some help
I have these two pieces of code, wich one is more readable? foreach decimal

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.