This is a discussion on Dont You Just Hate People With Different Resolutions? within the Programming Articles forums, part of the Webmaster Articles/Tutorials category; Ok, so you have a website. All done up very good content; You go to your mates house who has ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| | #1 (permalink) |
| Senior Member | Ok, so you have a website. All done up very good content; You go to your mates house who has a 14' Monitor and 800x600 resolution. You show him/her your site expecting them to be like all wow. And then; they see that they got to scroll left and right to see the page... One of the most deadly offences in web design. Im going to teach you a unbelievbly simple but effective javascript to redirect after determining the pc screen resolution. Firstly, put this inside your <body> tag, literally inside the tags Code: onload="redirectPage();" Code: <BODY onload="redirectPage();"> Code: //Change mydomain1.com to your domain/ that is compatible with the resolution concerned.
<SCRIPT LANGUAGE="JavaScript">
function redirectPage() {
var url800x600 = "http://www.yourdomain1.com/800x600isnotsupported.htm";
var url1024x768 = "http://www.yourdomain1.com";
if ((screen.width == 800) && (screen.height == 600))
window.location.href= url800x600;
else if ((screen.width == 1024) && (screen.height == 768))
window.location.href= url1024x768;
else window.location.href= url1024x768;
}
</SCRIPT>
Hope this helps; if you have any probs or comments please post below. Thanks.
__________________ -Gary |
| | |
| | #2 (permalink) |
| Super Moderator | Code: var url800x600 = "http://www.yourdomain1.com/800x600isnotsupported.htm"; What happens when I want to view your site on a PDA or phone ? You should look at CSS and provide a suitable styling for different media types. If you want to do any serious paid design, then you need to incorporate flexibility and adopt standards.
__________________ Alex Monaghan - Monaghan Consultants Ltd Web hosting, ADSL, IT & Database consultancy Custom Web hosting on UK or USA servers using Linux (cPanel) or Windows (DotNetPanel) Mobile Phone Ringtones, Logos, Java Games & more |
| | |
| Tags |
| hate, people, resolutions |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Hello People | YooHee | New Member Introductions | 2 | 05-09-2008 07:44 |
| family.....dont you just love 'em?!?! | Lewis | General Webmaster Discussion | 3 | 27-06-2005 21:03 |
| Gawd We All Hate Long URL's... | Departed | Ads, Offers & Services | 11 | 27-06-2005 16:17 |
| Hey just joined and i really dont know much about this place | thecsp | New Member Introductions | 2 | 15-02-2005 14:30 |