473,785 Members | 3,388 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

screen resolution

when I first started to write my page, I had my settings at 1024 x 768.

I then saw the page on a 800 x 600 computer - wow - what a difference!!!

I then went back and redid my page at 800 x 600.
now when I look at the page at a higher resolution, I am not happy with it.

How can I set the users computer (or page) to match what I want it to make
the page look it's best???

Thank you!!!!
Jul 23 '05 #1
10 1784
Hi Prophet,

Here's one solution. Try using the Screen object to see what the
user's current resolution is. Example:
window.screen.w idth and window.screen.h eight.

Pro:
You get what you want. i.e., you can make your page in different
resolutions and serve the correct the page depending on your user's
resolution.

Con:
If you have a big website, this can become a maintenance nightmare.

Jul 23 '05 #2

"web.dev" <we********@gma il.com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
Hi Prophet,

Here's one solution. Try using the Screen object to see what the
user's current resolution is. Example:
window.screen.w idth and window.screen.h eight.


as I am fairly new to this I am not sure how to use this...do I put in a
value for the height or width?
Jul 23 '05 #3
Hi Prophet,
as I am fairly new to this I am not sure how to use this...do I put in a value for the height or width?


You can do something like the following:

<script language = "javascript " type = "text/javascript">
<!--
var x = window.screen.w idth;
var y = window.screen.h eight;

if(x == 1024 && y == 768)
{
url = "page1.html "; //the url to the page for viewing in 1024x768
resolution
}
else if(x == 800 && y = 600)
{
url = "page2.html ; //the url to the page for viewing in 800x600
resolution
}

location.href = url; //redirect the user to the appropriate page
//-->
</script>

Don't forget to place the script in the <head> element. One more
thing, another con of this approach, the user can't effectively use the
'Back' button, because this script will keep taking them to the page
designated.

Jul 23 '05 #4
"web.dev" <we********@gma il.com> writes:

(Please cite some of the message you are responding to)
Here's one solution. Try using the Screen object to see what the
user's current resolution is. Example:
window.screen.w idth and window.screen.h eight.
Bad idea, generally.
Pro:
You get what you want. i.e., you can make your page in different
resolutions and serve the correct the page depending on your user's
resolution.
But the user's resolution is completely irrelevant. It fails to
provide any information about how the page looks.
- it does not say how many pixels the page will have available.
It's the browser size, not the screen size, that is relevant
for that.
- It doesn't say how big the pixles are (my 14' laptop monitor
does 1440x1050 whereas the old 15' monitor next to it only
does 1024x768).
Con:
If you have a big website, this can become a maintenance nightmare.


Absolutely. And remember that there are screen sizes other than
800x600 and 1024x768. Many, in fact. And even more browser sizes.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #5
Lee
web.dev said:

Hi Prophet,
as I am fairly new to this I am not sure how to use this...do I put in a value
for the height or width?

You can do something like the following:

<script language = "javascript " type = "text/javascript">
<!--


Neither the language attribute nor the SGML comment serves any purpose.
var x = window.screen.w idth;
var y = window.screen.h eight;


You really only need to look at either the width or the height.
Screen dimensions are fairly well standardized. It will also be
easier to maintain if the main page is designed for the higher
resolution, and you only redirect for anything smaller. Using
location.redire ct() allows the Back button to function normally:

if (screen.width<1 024) {
location.replac e("smallerVersi on.html");
}

Jul 23 '05 #6
"web.dev" <we********@gma il.com> writes:
You can do something like the following:

<script language = "javascript " type = "text/javascript">
You can safely drop the "language" attribute ...
<!--
and the HTML comment.
var x = window.screen.w idth;
var y = window.screen.h eight;

if(x == 1024 && y == 768) .... else if(x == 800 && y = 600)
What if my screen is not one of those two? In fact, it is 1600x1200.
Other common widths are 1152, 1280 and 1440. Heights can differ too,
sometimes independently.

If this should be worth anything, it should be based on browser
type, and not have these "dead angles", where it can't see what
to do. Something like:

var bw = window.innerWid th
|| (document.compa tMode == "CSS1Compat " ?
document.docume ntElement: document.body). clientWidth
|| 800;
location.replac e((bw <= 800) ? "page1.html " : "page2.html ");

.... Don't forget to place the script in the <head> element. One more
thing, another con of this approach, the user can't effectively use the
'Back' button, because this script will keep taking them to the page
designated.


Use location.replac e then. It replaces the current page in the browser
history, so the redirection page is not there.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #7
Lasse Reichstein Nielsen wrote:
[...]
- It doesn't say how big the pixles are (my 14' laptop monitor


14' = 4.267 metres!!

That ain't a laptop, that's a billboard - I'd like to see you totin'
that sucker on the bus!

:-)

--
Rob
Jul 23 '05 #8
RobG wrote:
Lasse Reichstein Nielsen wrote:
[...]
- It doesn't say how big the pixles are (my 14' laptop monitor

14' = 4.267 metres!!

That ain't a laptop, that's a billboard - I'd like to see you totin'
that sucker on the bus!


It's a double decker bus with a special door :)

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #9
RobG <rg***@iinet.ne t.auau> writes:
Lasse Reichstein Nielsen wrote:
[...]
- It doesn't say how big the pixles are (my 14' laptop monitor


14' = 4.267 metres!!

That ain't a laptop, that's a billboard - I'd like to see you totin'
that sucker on the bus!


Rightie! That should ofcourse have been inches, not feet. :P

/L 'message = message.replace (/(\d)'/,"$1\"");'
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
11069
by: ZaGras | last post by:
when my vb program run on another computer instead of my computer, the user interface is biggger..this is because of the screen resolution... anyone know how to solve pls?
23
4889
by: Dufe | last post by:
Hello all: To deal with the problem of differing user screen resolutions, I've explored: 1) making the pages in PHP, 2) having different pages on the same page and selecting the proper one via JavaScript, and 3) using fancy redirects and forced "back skip" redirects with cookies. Every approach has some fatal flaw as far as I have been able to persue it. My most recent idea is to make multiple style sheets (selectable via javascript...
5
4410
by: Chris | last post by:
After exhausting my search on the MS website, I can't find a straight answer. I fin dit hard to believe that MS left our something so useful in ASP.NET as screen resolution detection. Problem: I would like to detect, get values for, the screen resolution in px but in a code behind. Is this possible? There is a System.Windows.Forms.Screen class for the Windows client side, why are there none for browser/ASP.NET client?
4
15525
by: pjac | last post by:
I need some help with some VB language that will change the screen resolution on a monitor when a MS-Access 2000 database is opened from 1024 x 768 to 800 x 600. Any help with this effort would be deeply appreciated. Thanks in advance....
1
2174
by: fabrice | last post by:
Hi, I'm trying to get the screen resolution of the client and to realize a treatment in code behind. it seem to be hard. I can get information about the resolution with this following sub, call in Page_Load.I fix the text of The Control Label. But no treatment is possible. If i try to keep out the text of this label in code behind, i have nothing. The variable is empty.
6
2680
by: Darian | last post by:
I am wondering how (if it is possible of course) I can change a users screen resolution to a certain size when running my application and then change it back when they exit my application. For instance, if the users screen size is 800x600, I want the resolution to change to 1260x780 when running my program and then change back to 800x600 when exiting my program. Thanks, Darian
5
6208
by: Maxi | last post by:
I have a 30X16 cells table in my html page. Table height and width are set to 100%. I have set size of every cell inside the table to 24 pixel. When I open the html page in maximize state in either resolution 800 X 600 or 1152 X 864 it takes up the entire explorer size. In screen resolution 800 X 600, if I insert a pictures of 24 X 24 pixel in the cells it takes up the entire cell size (ideally it should as the cell size is also 24 X...
9
3908
by: Steve Wright | last post by:
Hi I'm developing a webpage that needs to include a different stylesheet depending on the screen resolution. I know that I could read the resolution in javascript and then do some sort of stylesheet switcher as part of the onload event but I would rather link in the correct stylesheet for the resolution in the first place.
1
2506
by: nasima khan | last post by:
Hi, i am nasima. I have got a code for setting the screen resolution of my page, but i am unable to understand. Can any one give a complete data explanation of the below code. Sub ChangeRes(X As Long, Y As Long, Bits As Long) Dim DevM As DEVMODE, ScInfo As Long, erg As Long, an As VbMsgBoxResult 'Get the info into DevM erg = EnumDisplaySettings(0&, 0&, DevM) 'This is what we're going to change DevM.dmFields =...
10
44087
by: =?Utf-8?B?UmljaA==?= | last post by:
A lot of users at my workplace use different screen resolutions, and I build apps to use 1680 x 1050 pixels res by default. But some users are using 800 x 600, and the apps are too large for their screen. I used to write code in Java a few years ago (2005), and you could stretch a form with the mouse and all the controls and fonts would resize to larger or smaller size. Does .Net framework 3.5 support this kind of functionality? Or -...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10087
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9947
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8971
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.