Solved

detect and resize webpage to clients screen resolution

Posted on 1998-08-23
6
556 Views
Last Modified: 2011-09-20
is there a way to detect the clients screen resolution and resize webpage to clients screen resolution.
thanks
0
Comment
Question by:dieken
6 Comments
 
LVL 8

Expert Comment

by:jbirk
ID: 1836932
Well, using JavaScript you can detect screen resolution on the 4.0+ browsers.  Using the commands screen.height and screen.width, you can determine their resolution.
I'm not usre if that's what you're looking for though.
Web pages naturally fill the space alloted to them by the screen, unless you specify specifically how much space they take up (like when using tables with pixel width specified, or using layers).

So do you have a specific problem where you would like it to be different depending on the screen resolution?  If so, I could help you to come up with a solution for your problem.

If you just want to play with screen resolution, then the two JavaScript commands I gave you will work for both IE 4 and Netscape 4.  Note that there are other complicated strange ways to get the screen size with older browsers, but it's not as reliable and is more work.
-Josh
0
 
LVL 6

Accepted Solution

by:
ckayter earned 70 total points
ID: 1836933
Josh is right about web pages automatically resizing. The caveat is that you do not specify widths in pixels for everything on the page.

For instance, for a two column table that you want to fill the page, give cell widths in percentages (i.e., width="50%"). This permits the page to spread on larger monitors, narrow on smaller monitors (or less-than-full-screen browser windows).

Colleen


0
 
LVL 8

Expert Comment

by:Answers2000
ID: 1836934
You can also detected screen resolution from the server, then using ASP, CGI or other server side methods send different pages based on the clients screen resolution.

I am currently using (somebody else's) CGI code to do this, so I can optimize my site for my most common client types (I don't bother drawing or referring different pages, but I guess I could if I wanted to).  

If you're interested, this technique also works for _most_ older browsers, for example, I currently have the followng info about hits on my site

RESOLUTION
Unknown < 1%
640X480 13%
800X600 37%
1024X768 29%
1152X864 6%
1280X1024 12%
1600X1200 < 1%

BROWSER
IE 4.x 42%
NS 4.x 28%
NS 3.x 15%
IE 3.x 9%
Opera x.x 1%
Unknown < 1%
IE 5.x < 1%
NS 2.x < 1%
IE 2.x < 1%
Unknown NS compatible < 1%

I also have stats of color depths and so forth.  Again the unknown % is very low, so the server side technique seems to be much more reliable.

0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 6

Expert Comment

by:ckayter
ID: 1836935
Answers2000 must have a techie or graphic audience. Most average folks I know (office employees who attend my classes, clients' employees, etc.) have 15" monitors and run 640x480. Looking at the stats for high-res and ver. 4 browsers, I don't think this is representative of most web users.

Dieken, you might check stats at zdnet.com in their internet computing magazine. They keep track of such things as overall average res, browser/ver. use, etc.

Would love to see Answers2000's URL posted....

Colleen

0
 

Author Comment

by:dieken
ID: 1836936
thanks
that helped me
0
 

Author Comment

by:dieken
ID: 1836937
http://www.worldwidemachine.com/logoreview.html
could somebody check the above url and see if it is adjusting to screen size properly. it is not on my machine
0

Featured Post

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question