auto detect screen resolution

auto detect screen resolution

بذریعہ Matt Brabender -
جوابات کی تعداد: 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?
درجہ بندی کا اوسط: -
Matt Brabender کے جواب میں

Re: auto detect screen resolution

بذریعہ 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