Solved

detect and resize webpage to clients screen resolution

Posted on 1998-08-23
6
558 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
Technology Partners: 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

Technology Partners: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
100% tall div not scrollable on iPhone 3 27
Set time on Session (ASP) 14 29
links not working 2 25
Link Anchor Not working 9 46
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
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.
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…
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 …

740 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