Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #23047
| Message-ID | <1669202.xfDvYs0WAe@PointedEars.de> (permalink) |
|---|---|
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Organization | PointedEars Software (PES) |
| Date | 2014-02-10 11:47 +0100 |
| Subject | Re: Different browsers display different widths - what gives |
| Newsgroups | comp.lang.javascript |
| References | <6845484e-2865-4c82-a1f2-d5e72e0db33c@googlegroups.com> |
compumatter.jay@gmail.com wrote:
^^^^^^^^^^^^^^^^^^^^^^^^^
Please get a real name and avoid the b0rken, sp0wned Google Groups.
> I'm blown away. I'm trying to establish a breakpoint for responsive
> commands and when testing the browsers window width or even an image width
> I'm getting accurate returns from Chrome and results that are way off by
> firefox and IE.
>
> Visit this page: http://sta.manageorsell.com/breakpoint.php with both
> Chrome and either firefox or IE.
Which of the numerous versions are you referring to?
> You will see my point.
You have yet to make one.
But if I were to make an educated guess, you are mystified as to why you are
getting different values with different browsers. If so, I have tested it:
I have a 1366×768 pixels display (TFT native resolution), and if I have the
Chromium 31.0.1650.63 Debian jessie/sid (238485) window in full screen, your
scripts says, from top to bottom, 1366, 1366, and 1350.
In Iceweasel 24.2.0, which is basically Firefox for Debian, in a full screen
window it says 1360, 1360 and 1344 – but only if I have View → “Sidebar
Switch” checked; otherwise it says the same as in Chromium.
I cannot test with IE right now, but I suspect the reason for any observed
differences will be equally trivial. OTOH, you have tested using jQuery, so
all bets are off.
> I've totally simplified the source code. I've even added a setInterval
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
No, you have not, and that is good so. However, you should have written
“window.setTimeout” instead, and then abandoned that unreliable approach in
favor of “load” and event listeners.
> to insure it had nothing to do with elements not being loaded yet.
But you have neither told much about your testing environment, anything
about your observations nor what you expected. Those are key points in a
problem description.
> I'm stupified...
>
> In todays responsive world a browser compatible method for testing the
> viewport / window width has to be among the most common needs for
> developers
Given CSS, including media queries and transitions, there rarely is a need
or want to test the viewport width using client-side scripting “in today’s
responsive world”. The window or screen width is, of course, largely
irrelevant.
> What sayeth the group ?
I sense much jQuery in you. jQuery is the path to the Dark Side.
jQuery leads to bloat behind the scenes. Bloat leads to inefficience
and incompatibility; those lead to suffering.
- <https://gist.github.com/chitsaou/3066411>
(however, I contest some of the statements there, especially on
compatibility);
- <http://www.fortybelow.ca/hosted/dhtmlkitchen/JavaScript-Query-Engines.html>
and
- numerous discussions here, see also <http://PointedEars.de/faq>
--
PointedEars
Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread
Different browsers display different widths - what gives compumatter.jay@gmail.com - 2014-02-09 13:09 -0800 Re: Different browsers display different widths - what gives "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-02-09 22:36 +0100 Re: Different browsers display different widths - what gives Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-02-10 11:47 +0100
csiph-web