Timeline for How to get browser width using JavaScript code?
Current License: CC BY-SA 3.0
13 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 8, 2021 at 20:40 | comment | added | Adam Fowler | Use jQuery in a react app? nah bro | |
Feb 8, 2018 at 21:45 | comment | added | Madness | @codechimp "Adding 30k lines of code to get window width is a BAD solution!" Proceeds to add a 80k file just to get window width. Bad is relative. | |
Feb 7, 2018 at 16:34 | comment | added | codechimp | Adding 30k lines of code to get window width is a BAD solution! | |
May 16, 2013 at 21:02 | history | edited | chaos | CC BY-SA 3.0 |
revert boundlessly idiotic bowdlerization
|
S May 16, 2013 at 17:19 | history | suggested | vasanth | CC BY-SA 3.0 |
explicit content
|
May 16, 2013 at 17:15 | review | Suggested edits | |||
S May 16, 2013 at 17:19 | |||||
Jan 19, 2013 at 10:17 | comment | added | Coder | I've found that $(window).width() does not always return the same value as innerWidth / clientWidth as per the examples in the answer below. jQuery's version doesn't take browser scrollbars into account (in FF anyway). This caused me a lot of confusion with CSS @media queries appearing to trigger at the wrong width. Using native code seems to be more reliable as it takes the appearance of the scrollbars into account. | |
Jun 24, 2009 at 14:44 | comment | added | chaos | The $(window).width() support in jQuery is since version 1.2, in case it's relevant to anybody. | |
Jun 24, 2009 at 14:43 | comment | added | chaos | Turns out you don't. Which is awesome. Edited answer per. Thanks for the heads-up. | |
Jun 24, 2009 at 14:43 | history | edited | chaos | CC BY-SA 2.5 |
deleted 34 characters in body
|
Jun 24, 2009 at 14:41 | comment | added | Nosredna | If I recalled correctly, jQuery has pulled much of dimensions into the core. Do you still need dimensions to do what you're suggesting? | |
Jun 24, 2009 at 14:37 | vote | accept | Amr Elgarhy | ||
Feb 4, 2019 at 9:16 | |||||
Jun 24, 2009 at 14:32 | history | answered | chaos | CC BY-SA 2.5 |