Solved

detect and resize webpage to clients screen resolution

Posted on 1998-08-23
6
554 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 6

Expert Comment

by:ckayter
Comment Utility
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
Comment Utility
thanks
that helped me
0
 

Author Comment

by:dieken
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now