Document width calculated via Javascript is different in Firefox compared to other browsers

Posted by Scarpelius on Stack Overflow See other posts from Stack Overflow or by Scarpelius
Published on 2012-04-04T08:43:42Z Indexed on 2012/04/04 11:29 UTC
Read the original article Hit count: 131

Filed under:
|
|

I have a problem with retrieving the current page document width from Mozilla Firefox. While the rest of the browsers report the correct width of the document, Firefox reports a smaller one (example: at screen resolution of 1920x1080 IE, Chrome and Safari reports 1920 while Firefox reports 1903).

I use document width in $(document).ready(function() { ... }); to reposition a div element. Funny this is that after using alert() inside this function, the element reposition correctly, though the document size is still smaller than other browsers.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery