The Idea (step by step):
user enters site (onLoad)
loads default.css page
the file "main.js" function setScreen(); finds the screen settings
the file "main.js" setStyle(); finds the browser
the file "main.js" loadCSS(filename); then calls the appropriate "*.css" file. (ie if the browser is iE then it would load "ieWidescreen.css" or "ieStandard.css"
user then interacts with site.
---
The Code:
(index.html):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="/css/main.css" type="text/css" media="all" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css" media="all">
@import url('./css/default/default.css');
</style>
<!-- load external .js file -->
<script type="text/javascript" src="/main.js"></script>
<!--[if IE><link href="/css/ie/default.css" type="text/css" media="all" /><![endif]-->
<title>Plaid Apple Studios</title>
</head>
<!-- This is the structure of the page -->
<body id="mainBody">
<div id="header1">- Plaid Apple Studios -</div>
<span id="menu1">Menu</span>
<!-- This is content for the page -->
<span id="contentOverlay1"></span>
<span id="contentBG">text</span>
<div id="valid" align="center"><p><img src="http://www.w3.org/Icons/valid-xhtml10" height="31" width="88" alt="img" />
<img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /></p>
</div>
</body>
</html>
(main.js):<!--
//Find monitor settings
var screenWidth = screen.width;
var screenHeight = screen.width;
var screenAvailWidth = screen.availWidth;
var screenAvailHeight = screen. availHeight;
//Find browser settings
var browserName = navigator.appCodeName;
var browserVer = navigator.version;
var browserPlat = navigator.platform;
var userAgent = navigator.userAgent;
//setup dimensions
if (screenWidth <= 1024)
{
if(screenHeight <= 768)
//screen resolution is standard
document.write("standard!");
}
else if (screenWidth <= 1280)
{
if (screenHeight <=1024)
//screen resolution is widescreen
document.write("Widescreen!");
}
//call proper pages
//load either widescreen IE.css or stanard IE.css
//if not IE then main.css and main.js. IE will not have Javascript
//support beyond parsing the broswer's info and screen info.
// -->
Thank you all for your time! I'm going to continue coding other parts as this is reviewed, and hopefully update this question with another...
Thank you again!
:thumbup:
Edited by Injury, 07 January 2011 - 08:50 AM.
More info!


Sign In
Create Account


Back to top










