auto detect screen resolution

auto detect screen resolution

by Matt Brabender -
Number of replies: 2
Does anyone have a function that auto detects the user's screen resolution and then runs an appropriate version of the site?

What would be involved in doing this if it's possible?
Average of ratings: -
In reply to Matt Brabender

Re: auto detect screen resolution

by J. Chan -

There's no need to detect the users' resolution. Simply apply the following codes to the header of any html page:

<script language="Javascript">

if (document.all || document.layers) {
        self.moveTo(0,0);
        self.resizeTo(screen.availWidth,screen.availHeight);

</script>

OR, apply the following to any php page:

<html>
<script language="Javascript">

if (document.all || document.layers) {
        self.moveTo(0,0);
        self.resizeTo(screen.availWidth,screen.availHeight);

</script>
</html>

Try and see.

Cheers

James