Template:Imperial/09/TemplateTop

From 2009.igem.org

(Difference between revisions)
Line 1: Line 1:
<html>
<html>
<script type="text/javascript">
<script type="text/javascript">
-
<!--
+
var viewportwidth;
-
 
+
var viewportheight;
-
var viewportwidth;
+
if (typeof window.innerWidth != 'undefined'){
-
var viewportheight;
+
-
+
-
// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
+
-
+
-
if (typeof window.innerWidth != 'undefined'){
+
       viewportwidth = window.innerWidth;
       viewportwidth = window.innerWidth;
       viewportheight = window.innerHeight;
       viewportheight = window.innerHeight;
-
}else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0){
+
}else if ((typeof document.documentElement != 'undefined') && (typeof document.documentElement.clientWidth) != 'undefined' && document.documentElement.clientWidth != 0){
-
      viewportwidth = document.documentElement.clientWidth;
+
      viewportwidth = document.documentElement.clientWidth;
-
      viewportheight = document.documentElement.clientHeight;
+
      viewportheight = document.documentElement.clientHeight;
-
}else{
+
}else{
-
      viewportwidth = document.getElementsByTagName('body')[0].clientWidth;
+
      viewportwidth = document.getElementsByTagName('body')[0].clientWidth;
-
      viewportheight = document.getElementsByTagName('body')[0].clientHeight;
+
      viewportheight = document.getElementsByTagName('body')[0].clientHeight;
-
}
+
}
alert('mad');
alert('mad');
document.write('<p>Your viewport width is '+viewportwidth+'x'+viewportheight+'</p>');
document.write('<p>Your viewport width is '+viewportwidth+'x'+viewportheight+'</p>');

Revision as of 14:23, 28 September 2009