0

I am currently using screen.height and screen.width to query screen size from the user. However, it seems that these functions do not always work. Is there a way to make query in a reliable way (across all browser and operating systems)?

mat
  • 2,412
  • 5
  • 31
  • 69
  • 3
    Why do I have a feeling that you did not search enough... – smnbbrv Jun 08 '17 at 15:34
  • I did search, they always seems to report these two functions – mat Jun 08 '17 at 15:35
  • First google result for me: http://ryanve.com/lab/dimensions/ – Halcyon Jun 08 '17 at 15:36
  • What do you mean by "not work"? – Max K Jun 08 '17 at 15:37
  • Possible duplicate of: https://stackoverflow.com/questions/3437786/get-the-size-of-the-screen-current-web-page-and-browser-window – Freeman Lambda Jun 08 '17 at 15:38
  • @FreemanLambda I have already checked that post. The problem is these two functions do not seems to be working across all browsers. – mat Jun 08 '17 at 15:39
  • That post has multiple other solutions, have you tried all of them to no avail? Furthermore, I fail to see how your question (as it is now) can gather more insight than a famous question with 1200 upvotes and a bunch of quality answers. Maybe if you describe clearly what do you mean by "it doesnt work", there can be some specific value in your question that we can squeeze out. – Freeman Lambda Jun 08 '17 at 15:43
  • Possible duplicate of [Get the size of the screen, current web page and browser window](https://stackoverflow.com/questions/3437786/get-the-size-of-the-screen-current-web-page-and-browser-window) – juvian Jun 08 '17 at 15:44
  • @FreemanLambda I just want to make sure that screen.width and screen.height are 100% compatible with all browsers, because it doesn't seems so. That's the problem. – mat Jun 08 '17 at 15:48
  • Why doesnt it seem so? Which browser is reporting wrong values? What is your source for making this statement? – Freeman Lambda Jun 08 '17 at 15:50
  • @FreemanLambda https://www.quirksmode.org/blog/archives/2013/11/screenwidth_is.html – mat Jun 08 '17 at 15:51

0 Answers0