Blue Ridge Software LLC
  Encryption
Services
  Webmaster
Services
  Programming   Software   About Us

Program Snippets

  Javascript - Load Stylesheet by Resolution (Add To Favorites)
// save following as external file styleSheetsbyResolution2.js
// and put this in head: <script type="text/javascript" src="styleSheetsbyResolution2.js"></script>

var winW = 0, winH = 0;

if (parseInt(navigator.appVersion)>3) {
 if (navigator.appName=="Netscape") {
  winW = window.innerWidth-16;
  winH = window.innerHeight-16;
 }
 if (navigator.appName.indexOf("Microsoft")!=-1) {
  winW = document.body.offsetWidth;
  winH = document.body.offsetHeight;
 }
}
if (winW <= 1600)  {
  document.write('<link rel="stylesheet" type="text/css" href="1600.css">');
}
if (winW <= 1280)  {
  document.write('<link rel="stylesheet" type="text/css" href="1280.css">');
}
if (winW <= 1024) {
  document.write('<link rel="stylesheet" type="text/css" href="1024.css">');
}
if (winW <= 800) {
  document.write('<link rel="stylesheet" type="text/css" href="800.css">');
}
if (winW <= 640) {
  document.write('<link rel="stylesheet" type="text/css" href="640.css">');
}
© 2013- Blue Ridge Software LLC