diff client/digitallibrary/navigation.js @ 199:21789f3f7251

Corrected Problems with innerWidth and about:blank for Safari.
author robcast
date Wed, 14 Jan 2004 12:06:53 +0100
parents 28f96364040f
children 7349d58cd391
line wrap: on
line diff
--- a/client/digitallibrary/navigation.js	Tue Dec 23 17:29:08 2003 +0100
+++ b/client/digitallibrary/navigation.js	Wed Jan 14 12:06:53 2004 +0100
@@ -118,11 +118,25 @@
 
   }
 
-  if ( document.body ) {
-  	queryString += "&dw=" + (document.body.clientWidth-30) + "&dh=" + (document.body.clientHeight-30);
-  } else {
-    queryString += "&dw=" + (innerWidth-30) + "&dh=" + (innerHeight-30);
+  // window size
+  var wwidth, wheight;
+  if (self.innerHeight) // all except Explorer
+  {
+      wwidth = self.innerWidth;
+      wheight = self.innerHeight;
   }
+  else if (document.documentElement && document.documentElement.clientHeight)
+  // Explorer 6 Strict Mode
+  {
+      wwidth = document.documentElement.clientWidth;
+      wheight = document.documentElement.clientHeight;
+  }
+  else if (document.body) // other Explorers
+  {
+      wwidth = document.body.clientWidth;
+      wheight = document.body.clientHeight;
+  }
+  queryString += "&dw=" + (wwidth-30) + "&dh=" + (wheight-30);
 
   queryString += "&lv=1";