auto detect end user screen resolution

liunx

Guest
Hi guys,<br />
<br />
Is there a way of automatically detecting what screen resolution people looking at your site are using?<br />
<br />
Things look so different when one guy uses an 800 x 600 screen and another uses 1280 x 1024.<br />
<br />
I know I can use Center but images and text sizes are just so different. Just thought I could detect the size and automatically amend the text size etc.<br />
<br />
Anyway, if anyone out there knows, I'd be grateful.<br />
<br />
Cheers guys.<br />
<br />
Biker (John) :hotbounce :hotbounce :hotbounce<!--content-->using java script, the built-in screen function would work for ya...<br />
<br />
<br />
screen.availHeight ( in pixels, the available height of the screen after any taskbars and ofice bars )<br />
screen.availWidth ( in pixels, the available width of the screen after any taskbars and ofice bars )<br />
screen.colorDepth<br />
screen.height<br />
screen.width<!--content-->Many thanks, I will give it a go - it's mainly for the centre frame but I guess the whole site will be better for knowing. The site is <!-- w --><a class="postlink" href="http://www.playa-del-ingles.net">www.playa-del-ingles.net</a><!-- w --> but it will be down whilst I change my isp service from 27th March to about 8th April. Gives me time to work on a solution.<br />
<br />
It's a boring site, I plan on upgrading it with Flash later in the year - when I get time! (However it does get results!)<br />
<br />
Cheers again<br />
<br />
Biker<!--content-->Don't just test for the common 800x600 and 1024x768 resolutions, but also provide a solution for people using sizes smaller than those, larger then those, and test to see if anyone uses something non-standard between those two sizes.<!--content-->Yes, ppoint taken, I was going to use less than and greater than but just go with 3 basic sizes for images and text size. I thought I would keep the data in SQL Server so I can get a rough idea of the sizes most people use, I can't cater for everything. I have used Nedstat and I only get 3% of users with Netscape, the rest is IE5 or 6 and mainly 800 x 600 and 1024 x 728 (I think it is). I develop on 1280 x 1024 so have to curtail myideas somewhat <g><br />
<br />
Anyway, thanks for your help.<br />
<br />
Biker<!--content-->What is it you want to do. I came up with a dynamic way of laying out images and content the other day. This doesnt use a script at all but tables. If you give me an idea of what you want to achive i'll try an describe how to do it.<!--content-->If you look at the site I have divided it up into 4 frames.<br />
A top banner which I want to change to Flash at some point.<br />
A left hand navigation bar<br />
A right hand advertising bar<br />
The middle where photos, text etc are.<br />
<br />
<!-- w --><a class="postlink" href="http://www.playa-del-ingles.net">www.playa-del-ingles.net</a><!-- w --> - but it goes offline in 2 days (27th) for 10 days.<br />
<br />
<br />
BTW, how do I get at the data coming back from <br />
screen.availheight<br />
screen.availwidth etc?<br />
<br />
? <br />
dim a, b as string<br />
a = screen.availheight.value<br />
b = screen.availwidth.value<br />
?<br />
I am using Visual Studio .NET - ASP - VB.NET.<br />
<br />
Thanks,<br />
<br />
Biker<!--content-->Mm, Canary Islands... When it's -20 degrees Celcius in December here in Finland, it's warm and sunny there...<br />
<br />
let's get back to reality from my dreams... screen.availWidth and so on are JavaScript, not VBScript commands. I don't know if there is a way how to return the visitor's screen size etc. using VBScript, and if there is, I don't know how to.<!--content-->BTW, JavaScript, and as far as I know also VBScript are case-sensitive, so the correct "spelling" is screen.availWidth, not screen.availwidth.<!--content-->I can run javascript from within Visual Studio in the HTML section - no problems. However being a simpleton how do I get to the results? What is the syntax to make a label.text = screen.availWidth ?<br />
<br />
And yes, Canaries are nice and warm, off out there next month all being well!<br />
<br />
Thanks<br />
<br />
Biker<!--content-->You should know JavaScript for that... What do you want to use them for?<!--content-->
 
Back
Top