0 Replies - 1158 Views - Last Post: 07 May 2005 - 10:58 AM

#1 wiredwizard   User is offline

  • D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 76
  • Joined: 07-May 05

getScreenProp.cfm

Posted 07 May 2005 - 10:58 AM

Description: will need style sheet for all of following
ie 800x600 = global.css
ie 1024 = globallg.css
netscape 800 = nglobal.css
and so forthcustom tag used to load css based on screen resolution, operating system, and browser
<script language="Javascript" type="text/Javascript">
var screen_width = screen.width;
var myflag = false
if(navigator.appName == "Microsoft Internet Explorer" && screen_width <= 800 && navigator.appVersion.indexOf("Win")!=-1) {
      document.write("<link href="global.css" rel="stylesheet" type="text/css" />");
      myflag = true;
}

if(navigator.appName == "Microsoft Internet Explorer" && screen_width >= 1024 && navigator.appVersion.indexOf("Win")!=-1) {
      document.write("<link href="globalLg.css" rel="stylesheet" type="text/css" />");
      myflag = true;
}

if(navigator.appName == "Netscape" && screen_width <= 824 && navigator.appVersion.indexOf("Win")!=-1) {
      document.write("<link href="nglobal.css" rel="stylesheet" type="text/css" />");
      myflag = true;
}


if(navigator.appName == "Netscape" && screen_width >= 1024 && navigator.appVersion.indexOf("Win")!=-1) {
      document.write("<link href="nglobalLg.css" rel="stylesheet" type="text/css" />");
      myflag = true;
}

if(navigator.appName == "Microsoft Internet Explorer" && screen_width <= 820 && navigator.appVersion.indexOf("Mac")!=-1) {
      document.write("<link href="macglobal.css" rel="stylesheet" type="text/css" />");
      myflag = true;
}

if(navigator.appName == "Microsoft Internet Explorer" && screen_width >= 1024 && navigator.appVersion.indexOf("Mac")!=-1) {
      document.write("<link href="macglobalLg.css" rel="stylesheet" type="text/css" />");
      myflag = true;
}

if(navigator.appName == "Netscape" && screen_width <= 824 && navigator.appVersion.indexOf("Mac")!=-1) {
      document.write("<link href="macnglobal.css" rel="stylesheet" type="text/css" />");
      myflag = true;
}


if(navigator.appName == "Netscape" && screen_width >= 1024 && navigator.appVersion.indexOf("Mac")!=-1) {
      document.write("<link href="macnglobalLg.css" rel="stylesheet" type="text/css" />");
      myflag = true;
}

if (myflag == false) {
      document.write("<link href="global.css" rel="stylesheet" type="text/css" />");
}

</script>


Is This A Good Question/Topic? 0
  • +

Page 1 of 1