Solved

detect and resize webpage to clients screen resolution

Posted on 1998-08-23
6
560 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

 
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

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

617 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