1

as a webpage developer i would like to know if there is any way i can know the aspect ratio of users monitor(those who are using a PC or a Mac). i want to forward different pages(in terms of their page layout) to different users based on their screen size and aspect ratio. is this possible ?

Chani
  • 5,055
  • 15
  • 57
  • 92
  • 1
    Do note that many people don't maximize their browser window. The aspect ratio and the browser viewport may be very different. – ceejayoz Dec 27 '10 at 17:42

1 Answers1

2

Why not retrieve their desktop size and find the ratio yourself?

var ratio = screen.width / screen.height;
if (ratio == (4/3)) {
  // 4:3 ratio
} else if (ratio == (3/2)) {
  // 3:2
} else if (ration == (16/9)) {
  // 16:9
} /* etc. */
Brad Christie
  • 100,477
  • 16
  • 156
  • 200