3135 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 500+ items on Envato Market
+4 more
Daniel_R says

Hello creative nation! I hope you all are doing awesome.

I dont know if this is the right place to post but Im looking for a script to detect the user display monitor size.

I have a website for wallpapers and I want the website to be able to automatically detect the correct display monitor size and suggest it to the user so he/she an download the right wallpaper size.

Any suggestions ideas will be much appreciate it. THanks!

240 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Has been part of the Envato Community for over 4 years
+2 more
phpdude says

Hi Daniel,

It’s pretty simple to detect browser size, and there are two options:

Option 1 – Handle it all via JavaScript Browser sizes can only be grabbed by JavaScript using window.screen.width and window.screen.height

Option 2 – Send the JavaScript variables to PHP If you need to use PHP to manipulate the site, then you can parse the JavaScript variables to PHP via an AJAX call so it would access the url like this:

script.php?width=window.screen.width&height=window.screen.height.

This is a good place and should get you started: http://stackoverflow.com/questions/1504459/getting-the-screen-resolution-using-php

3135 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $1,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 500+ items on Envato Market
+4 more
Daniel_R says

Hi Daniel,

It’s pretty simple to detect browser size, and there are two options:

Option 1 – Handle it all via JavaScript Browser sizes can only be grabbed by JavaScript using window.screen.width and window.screen.height

Option 2 – Send the JavaScript variables to PHP If you need to use PHP to manipulate the site, then you can parse the JavaScript variables to PHP via an AJAX call so it would access the url like this:

script.php?width=window.screen.width&height=window.screen.height.

This is a good place and should get you started: http://stackoverflow.com/questions/1504459/getting-the-screen-resolution-using-php

thank you so much for your help! This helps!

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by