auto detect screen resolution

auto detect screen resolution

Bởi Matt Brabender -
Số lượng các câu trả lời: 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?
Trung bình điểm đánh giá: -
Để phản hồi tới Matt Brabender

Re: auto detect screen resolution

Bởi 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