Click to See Complete Forum and Search --> : auto resolution?


greglutz
01-24-2003, 12:48 AM
How do you make a webpage be automatically fitted to any user's resolution that they have on their monitor?
Say the user has a resolution of 600 X 800 on their monitor, but you used a resolution of 1024X 768 to create your webpage. How do you get it to fit the user's browser?

Stefan
01-24-2003, 02:01 AM
Very easy, you don't need to do ANYTHING. :)

If you don't add a lot of restrictions to you webpage in size it will automatically fit on any resolution a visitor has.

Only when you start to abusing table for general page layout and/or specify fixed width all over the place will your page be limited to a certain size.

Skrlin Site
01-24-2003, 12:01 PM
Basically start with something that fits 800x600 resolutions, and use percent-based width/height (i.e. <table border=0 height="100%" width="80%">) and try not to use fixed-width/height (i.e. <table border=0 height=600 width=640>)

You can use JavaScript to dynamically build your site based on resolution size using anywhere from resolution-based fixed-width/height tags, to resolution-based images and CSS specifications. The former is the easy way out, but if you want it complicated then go to your local library and pick up a JavaScript or DHTML book, or do some online research and have fun!

azcn2503
01-26-2003, 06:59 AM
You could alert your user and tell them that their browser resolution is low, and therefore, you recommend them raising it.

place this in the head section of your web page:


<script language="javascript">
function resdetect(recwidth,recheight){
if (screen.width<recwidth && screen.height<recheight){
window.alert("Your resolution: " + screen.width + "x" + screen.height + ".\nRecommended resolution: " + recwidth + "x" + recheight + ".\n\nWe recommend raising your resolution to at least " + recwidth + "x" + recheight + ".");
}
</script>


And then make your body tag say this:


<body onLoad="resdetect(1024,768);">


You can of course add your regular body tag ammenities to that, there is no real limit with webdesign.

greglutz
01-27-2003, 03:51 PM
Thank you for all of your comments but I'm not getting what I'm looking for.
Is there a code or something that can change the user's resolution automatically?
Is there a code to detect what kind of resolution the user has and then send them to the appropiate web page, or adjust the webpage to fit their resolution?
Can anyone help?
email me if you want to (gregorymichaellutz@hotmail.com)

azcn2503
01-28-2003, 10:40 AM
Sorry mate :( I don't think javascript is powerful enough to change system settings, like the resolution for example. It's probably worth asking a JS expert. I've only been doing JS for a couple of months.