By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,246 Members | 1,515 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,246 IT Pros & Developers. It's quick & easy.

Is it possible to reset the screen resolution in Javascript?

P: n/a
I want to place some graphic images on the web that are optimally viewed at
a resolution of 1024 by 768 pixels. Is it possible, within Javascript,to
force a particular screen resolution?
Oct 11 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
TC

Norman Swartz wrote:
I want to place some graphic images on the web that are optimally viewed at
a resolution of 1024 by 768 pixels. Is it possible, within Javascript,to
force a particular screen resolution?
Let me argue the case for why you should not even -think- of doing
that.

Say you have an image that is larger than the browser window. IE has a
setting where you can choose from one of two behaviours: (a) reduce the
image in size to fit in the window, or (b) display the image in full
size & add scrollbars accordingly.

Some folks prefer option (a). I personally prefer option (b). Can you
imagine how peeved I would be, if some webste (or program) changed my
setting from (b) to (a)? I would simply change it back, and never go to
that website again.

The same apples to other screen related settings such as resolution,
default text size, desktop wallpaper, and so on. These are -personal-
settings, and it is not appropriate for any program or website to
change them, without the user's consent.

In addition, the user might have other, technical reasons for wanting
to use a lower resolution. Perhaps he can't read text at higher
resolutions. Perhaps he constantly uses a program that requires the
lower resolution. Perhaps his favourite game crashes the PC, when it is
run at higher resolutions. What if you change the resolution, and his
favourite game (which happens to be running at that time), instantly
crashes his PC?

Believe me: you do not want to do what you've asked. If you -did-,
then, many people would never visit your site again.

HTH,
TC (MVP MSAccess)
http://tc2.atspace.com

Oct 11 '06 #2

P: n/a
On Wed, 11 Oct 2006 00:11:48 -0700, TC wrote:
>
Norman Swartz wrote:
>I want to place some graphic images on the web that are optimally viewed at
a resolution of 1024 by 768 pixels. Is it possible, within Javascript,to
force a particular screen resolution?

Let me argue the case for why you should not even -think- of doing
that.
Let me do the same thing faster: My machine does not belong to you!
Oct 11 '06 #3

P: n/a
"Norman Swartz" <sw****@sfu.cawrote in message
news:Xn*************************@64.59.144.76...
I want to place some graphic images on the web that are optimally viewed
at
a resolution of 1024 by 768 pixels. Is it possible, within Javascript,to
force a particular screen resolution?
You could probably detect the visitor's current resolution
then refuse to display your page until they changed it. :)
Oct 11 '06 #4

P: n/a
Norman Swartz <sw****@sfu.cawrote in
news:Xn*************************@64.59.144.76:
I want to place some graphic images on the web that are optimally
viewed at a resolution of 1024 by 768 pixels. Is it possible, within
Javascript,to force a particular screen resolution?
Detect the current resolution.
If it isn't what you want, put up an alert:
alert("This page best viewed with a screen resolution of 1024 x 768");
and let the viewer decide to change it (or not).
Oct 11 '06 #5

P: n/a

Norman Swartz wrote:
I want to place some graphic images on the web that are optimally viewed at
a resolution of 1024 by 768 pixels.
That might be the best setting for you, on your screen, using your
browser, but you don't know the physical characteristics of my screen
or my particular viewing requirements, therefore you can't possibly
know what *I* think is optimal.

Provide advice to the user about the characteristics of the images you
are about to display and let them decide. Do not make statements like
"best viewed at 1024x768", tell them "The following images are 1024x768
pixels in 24bit colour" or whatever. Then let the viewer decide if
they want to see them full-screen (whatever that might be for them) or
at some other setting.

Remember your viewers may be using displays anywhere from say 320x240
to 1600x1200 and beyond, at a variety of aspect ratios (say anywhere
from 4:3 to 16:9 and higher) oriented to either landscape or portrait.
They may want images stretched to the edges or not, or reduced to fit,
or not.

Is it possible, within Javascript,to
force a particular screen resolution?
No, thankfully.
--
Rob

Oct 12 '06 #6

P: n/a
JRS: In article <Xn*************************@64.59.144.76>, dated Wed,
11 Oct 2006 06:39:59 remote, seen in news:comp.lang.javascript, Norman
Swartz <sw****@sfu.caposted :
>I want to place some graphic images on the web that are optimally viewed at
a resolution of 1024 by 768 pixels. Is it possible, within Javascript,to
force a particular screen resolution?
Other considerations apart, that is a stupid question.

Given that, because you have an image almost as big as 1024*768, so that
it more-or-less fills the available area of a browser used full-screen
on a 1024*768 display, and it looks nice on your 17" 1024*768 screen -

Why do you want to force a user who has a 34" 2048*1536 display to
change mode to 1024*768 and see rather large pixels, when he can
perfectly well see just what you can see in a browser window occupying a
quarter of the screen area?

It's a good idea to read the newsgroup and its FAQ. See below.
--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
<URL:http://www.jibbering.com/faq/>? JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Oct 12 '06 #7

P: n/a
On 11 Oct 2006 17:51:46 -0700, in comp.lang.javascript "RobG"
<rg***@iinet.net.au>
<11*********************@k70g2000cwa.googlegroups. comwrote:
>|
| Norman Swartz wrote:
| I want to place some graphic images on the web that are optimally viewed at
| a resolution of 1024 by 768 pixels.
|
| That might be the best setting for you, on your screen, using your
| browser, but you don't know the physical characteristics of my screen
| or my particular viewing requirements, therefore you can't possibly
| know what *I* think is optimal.
|
| Provide advice to the user about the characteristics of the images you
| are about to display and let them decide. Do not make statements like
| "best viewed at 1024x768", tell them "The following images are 1024x768
| pixels in 24bit colour" or whatever. Then let the viewer decide if
| they want to see them full-screen (whatever that might be for them) or
| at some other setting.
|
| Remember your viewers may be using displays anywhere from say 320x240
| to 1600x1200 and beyond, at a variety of aspect ratios (say anywhere
| from 4:3 to 16:9 and higher) oriented to either landscape or portrait.
| They may want images stretched to the edges or not, or reduced to fit,
| or not.
To add to the above:
which of the 3 monitors of mine would you change?
I have 2 video cards running 3 monitors and each monitor is at a
different resolution.
>| Is it possible, within Javascript,to
| force a particular screen resolution?
|
| No, thankfully.
---------------------------------------------------------------
jn******@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Oct 12 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.