How to check screen resolution

7 posts Page 1 of 1
Contributors
User avatar
Bogoh67
VIP - Site Partner
VIP - Site Partner
Posts: 656
Joined: Sun Apr 18, 2010 8:20 pm

How to check screen resolution
Bogoh67
How do I check screen res in HTML because i am making a iPod or iPhone version for a website and I want it to check screen res to determine whether or not it will be mobile
User avatar
mikethedj4
VIP - Site Partner
VIP - Site Partner
Posts: 2592
Joined: Thu Mar 25, 2010 4:36 am

I don't know much about making apps on an iOS device, and you'd most likely haft to use Javascript (or JQuery), or XCode for this.
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: How to check screen resolution
mandai
If you use JavaScript then you can check with screen.width and screen.height.
User avatar
Bogoh67
VIP - Site Partner
VIP - Site Partner
Posts: 656
Joined: Sun Apr 18, 2010 8:20 pm

Re: How to check screen resolution
Bogoh67
ok so mandai i basicallly know nothing about HTML
where would i put it in CSS or wherever it goes and if a site is in HTML can i put javascript it in or not?
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

Re: How to check screen resolution
Axel
Bogoh67 wrote:
ok so mandai i basicallly know nothing about HTML
where would i put it in CSS or wherever it goes and if a site is in HTML can i put javascript it in or not?
somewhere in your html file , I would place it between <head><script> and </head></script> I think that would work
http://vagex.com/?ref=25000
User avatar
Bogoh67
VIP - Site Partner
VIP - Site Partner
Posts: 656
Joined: Sun Apr 18, 2010 8:20 pm

Re: How to check screen resolution
Bogoh67
umm where would i find that if my friend has a .webs website hoster
User avatar
Codex
Coding God
Coding God
Posts: 2028
Joined: Wed Mar 31, 2010 5:50 pm

Re: How to check screen resolution
Codex
Open your HTML file,
go to the body (<body>)
under it, add a link, and href = "javascript:alert('Your resolution is '+screen.width+' x '+screen.height);"

Example of your HTML file result:
Code: Select all
<html>
<head>
...
</head>
<body>
...
<a href="javascript:alert('Your resolution is '+screen.width+' x '+screen.height);">Screen Resolution</a>
...
</body>
</html>
We shall let the revolution begin.. the revolution for freedom, freedom against censorship. We shall fight in the fields and in the streets, we shall fight in the hills; we shall never surrender
7 posts Page 1 of 1
Return to “Help & Support”