Solved

detect and resize webpage to clients screen resolution

Posted on 1998-08-23
6
559 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
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…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

751 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