Skip to main content
Geppetto Luis
Legend
November 4, 2018
Answered

Screen resolution

  • November 4, 2018
  • 2 replies
  • 1694 views

I work with different screen resolutions

I would like this if possible

if the screen resolution and 1920px or higher does one thing

If the resolution is less than 1920 px, it does something else.

This topic has been closed for replies.
Correct answer r-bin

if ($.screens[0].right == 1920)

    alert(1920)

else                 

    alert()

2 replies

r-binCorrect answer
Legend
November 5, 2018

if ($.screens[0].right == 1920)

    alert(1920)

else                 

    alert()

JJMack
Community Expert
Community Expert
November 4, 2018

1920 is not screen resolution its the number of pixels in the width and 1080 would me the number of pixel high. the are many different size 1920x1080 displays  each size has its ppi resolution they are all not the same resolution the all display 1920x1080 pixels.  You can have more than one display and the do not need to display the same number of pixels or have the same resolution. A window can span across displays for example  your desktop background wall paper.

Here I have 3 displays two are 1600x1200 100ppi resolution and one is a 3840x2160 with a 185ppi resolution. My wall Paper has three sections and the section are for a single image scaled to two different resolution in three sections,  Look at the screen capture.

JJMack
Known Participant
November 4, 2018

JJMaak

I need to know the resolution of the screen in use

I do not have to use 3 screens

if I use a screen with a resolution lower than 1920px long side

It leaves notice that it is less than 1920px

if I use a screen with a resolution higher than 1920px long side

exits notice that is above 1920px

JJMack
Community Expert
Community Expert
November 4, 2018

It upsets me a bit when manufactures and users refers to a displays number of  pixels as  resolution.  It is not the Displays pixels density  it PPI resolution.  You may want to check out  Photoshop  screens array.

alert($.screens)

You should be able to calculate each displays number of pixels not their resolution.  You would need to know the display size to be able to calculate their resolution

JJMack