Free Games Forum
Free Games Games Forums Music Forums TV Forums

  Free Games Forum Home FORUM
HOME
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN
Rules & FAQ RULES / FAQ
REPORT SPAM

Free Games Forum: Game Technology: Javascript Coding:
Check your viewers' screen size.

 

 


Jaymzanator
Enthusiast


Jan 3, 2007, 12:07 AM

Post #1 of 1 (300 views)
Shortcut
Check your viewers' screen size. Can't Post


Code
<table border="0"> 
<tr>
<td><form method="POST" name="t">
<table border="0">
<tr>
<td valign="top" width="150"
bgcolor="#00FFFF"><strong>Your screen's width:</strong></td>
<td><input type="text" size="20"
name="t1" value="not supported"></td>
</tr>
<tr>
<td valign="top" width="150"
bgcolor="#00FFFF"><strong>Your screen's height:</strong></td>
<td><input type="text" size="20"
name="t2" value="not supported"></td>
</tr>
<tr>
<td valign="top" width="150"
bgcolor="#00FFFF"><strong>Your screen's color Depth:</strong></td>
<td><input type="text" size="20"
name="t3" value="not supported"></td>
</tr>
<tr>
<td valign="top" width="150"
bgcolor="#00FFFF"><strong>Your screen's pixel Depth:
</strong></td>
<td><input type="text" size="20"
name="t4" value="not supported"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<p align="left">
<script>
<!--

function show(){
if (document.all||document.getElementById||document.layers){
document.t.t1.value=screen.width
document.t.t2.value=screen.height
document.t.t3.value=screen.colorDepth
document.t.t4.value=screen.pixelDepth
}
}
show()
//-->
</script>


This produces a nice little table. just put it in the body where you want it placed. it can be quite useful if you have styles that rely on a certian screen size. im sure you could write a little script that will redirect them to a different page for retards if the resolution = 800x600. Wink


(17:20) Taz:
and tazg is lol'in at you all the way from canada
(17:21) James:
lol canadians


 
 
 


Search for (options) Web Design by Web Ideas - Page loaded in: 0.10 s on (CGI/1.1)