473,322 Members | 1,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Is it possible to reset the screen resolution in Javascript?

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
7 2421
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
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
"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
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

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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ralph Freshour | last post by:
Is there a way I can get the screen resolution using PHP? I want to set some parameters depending upon whether the user's screen is 800 wide or 1024 wide. Thanks...
6
by: mgandra | last post by:
What is best way to find browser screen width using javascript that is compatible with all types of browsers.
7
by: Robert Bull | last post by:
I have created an asp.net app on my machine where the resolution is set to 1280 x 1024. When my users view the form on their screen, some of the controls display differently than on my screen. One...
4
by: UJ | last post by:
I have a client who wants me to make a web page with a marquee on it. No problem. They want the text to be easily changeable. No problem. They want it so that the text will appear about the...
18
by: DavidS | last post by:
Have resW=screen.width; resH=screen.height in javascript. How can I read these values in ASP.NET source code - Page_Load function of code behind? Any suggestions?
7
by: tim | last post by:
can someone tell me which function returns the screen resolution in java script?
11
by: srini | last post by:
Frens, I am trying to get screen resolution of the client machine using javascript and use those values in my project. I looked at some of the examples given in this group, i tried to implement...
31
by: melinama | last post by:
Hello, I've looked through alt.html and this group for an answer to my question. However, I found only cranky arguments with, occasionally, bits of hard-to-understand code - out of context -...
6
mikek12004
by: mikek12004 | last post by:
I want to load a different swf in PHP based on the viewer's screen resolution. All would be fine if I could get the screen resolution in a variable in PHP. Problem is that after I done a bit of a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.